Stabilize the copy_closures and clone_closures features#49299
Stabilize the copy_closures and clone_closures features#49299bors merged 3 commits intorust-lang:masterfrom
Conversation
In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do.
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @withoutboats (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
src/librustc/traits/select.rs
Outdated
There was a problem hiding this comment.
I’m not confident about this particular chunk, but tests appear to be happy.
There was a problem hiding this comment.
seems ok. The name of the variable is weird; I would prefer is_copy_trait and is_clone_trait or something.
src/libcore/marker.rs
Outdated
There was a problem hiding this comment.
Clone
is that a typo for Copy?
There was a problem hiding this comment.
Oops, hasty copy-paste. Good catch, thanks. I just squashed a fix.
nikomatsakis
left a comment
There was a problem hiding this comment.
do you mind changing the names of those variables? otherwise r=me :)
|
Yes, this code is much less confusing with those variable names. Done, thanks. |
|
@bors r=nikomatsakis |
|
📌 Commit 1efe0b3 has been approved by |
Stabilize the copy_closures and clone_closures features In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do. Tracking issue: rust-lang#44490
Stabilize the copy_closures and clone_closures features In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do. Tracking issue: rust-lang#44490
In addition to the
Fn*family of traits, closures now implementCopy(and similarlyClone) if all of the captures do.Tracking issue: #44490