-
Notifications
You must be signed in to change notification settings - Fork 13.4k
std: Add impl of FnOnce to AssertRecoverSafe #32102
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
Conversation
r? @aturon |
/// // ... | ||
/// ``` | ||
/// | ||
/// Sometimes this behavior may be a bit too coarse grained, however, and |
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.
I think this comment is kind of vague. I would maybe say something like:
Wrapping the entire closure amounts to a blanket assertion that all captured variables are recover safe. This has the downside that if new captures are added in the future, they will also be considered recover safe. Therefore, you may prefer to just wrap individual captures, as shown below. This is more annotation, but it ensures that if a new capture is added which is not recover safe, you will get a compilation error at that time, which will allow you to consider whether that new capture in fact represent a bug or not.
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.
Thanks! Updated with this text.
This was originally intended, but forgot to land by accident! cc rust-lang#27719
5353be5
to
ec58f40
Compare
Is there a reason not to have |
|
@bors: r+ |
📌 Commit ec58f40 has been approved by |
yes
no.
|
We could certainly add |
Yeah I hadn't absorbed that the only place you'd want this is on the argument to |
⌛ Testing commit ec58f40 with merge 3412421... |
💔 Test failed - auto-mac-64-opt |
@bors: retry On Thu, Mar 10, 2016 at 11:56 AM, bors [email protected] wrote:
|
std: Add impl of FnOnce to AssertRecoverSafe This was originally intended, but forgot to land by accident! cc #27719
This was originally intended, but forgot to land by accident!
cc #27719