-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow conditional Send
futures in future_not_send
#13590
base: master
Are you sure you want to change the base?
Conversation
r? @Alexendoo rustbot has assigned @Alexendoo. Use |
Do we think people will enable this config? I can't come up with a good case it would catch |
Not sure, probably not. The only thing I could think of is potentially better errors at the definition/call site directly if everything is required to be |
bae9352
to
469eced
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ICE path isn't really reachable anymore for this test since the function is generic so I'm not sure it's still useful to have, and if I understand the original ICE correctly it would have happened for all the regular tests anyway (anything that led to the .err_ctxt()
call)?
I left the config option in as a commit for now in case it's still useful but I'll squash it away before the merge |
Looks good! Can r=me after the squash |
469eced
to
1309e8f
Compare
Send
futures by default in future_not_send
Send
futures in future_not_send
Closes #6947
This changes the lint to allow futures which are not
Send
as a result of a generic type parameter not having aSend
bound and only lint futures that are always!Send
for any type, which I believe is the more useful behavior (like the comments in the linked issue explain).This is still only a heuristic (I'm not sure if there's a more general way to do this), but it should cover the common cases I could think of (including the code examples in the linked issue)
changelog: [
future_not_send
]: allow conditionalSend
futures