-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Make Copy a subtrait of Clone #23860
Conversation
e340206
to
a608750
Compare
@@ -8,10 +8,18 @@ | |||
// option. This file may not be copied, modified, or distributed | |||
// except according to those terms. | |||
|
|||
<<<<<<< HEAD |
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.
this can't be right.
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 would guess not
r=me once bad merge is resolved. |
☔ The latest upstream changes (presumably #23673) made this pull request unmergeable. Please resolve the merge conflicts. |
f081d19
to
eb8315a
Compare
Created a discuss thread about this PR http://internals.rust-lang.org/t/making-copy-a-subtrait-of-clone-pr-23860/1777 |
eb8315a
to
32b6ec6
Compare
I have always assumed that Turns out that 👍 😃 |
@bors r=aturon 32b6ec6 |
oh, needs merge. |
32b6ec6
to
a758cf5
Compare
☔ The latest upstream changes (presumably #23549) made this pull request unmergeable. Please resolve the merge conflicts. |
a758cf5
to
1b5ac16
Compare
@bors r= aturon 1b5ac16 |
📌 Commit 1b5ac16 has been approved by `` |
@bors r=aturon 1b5ac16 |
1b5ac16
to
c35c468
Compare
Would this bloat crate size for crates that derive I'm also a bit concerned if this affects |
@Manishearth that should be fixed by the most recent push. |
☔ The latest upstream changes (presumably #23955) made this pull request unmergeable. Please resolve the merge conflicts. |
Conflicts: src/test/compile-fail/coherence-impls-copy.rs
gah I missed this in the rollup! |
As per rust-lang/rust#23860, Copy now extends Clone. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
As per rust-lang/rust#23860, Copy now extends Clone. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Fixes for change introduced by rust-lang/rust#23860
Swap order of input and output parameters of ptr::copy_nonoverlapping (rust-lang/rust#23866), remove usage of std::num::Int (rust-lang/rust#23549), change (rust-lang/rust#23860).
Swap order of input and output parameters of ptr::copy_nonoverlapping (rust-lang/rust#23866), remove usage of std::num::Int (rust-lang/rust#23549), change (rust-lang/rust#23860).
Fixes for change introduced by rust-lang/rust#23860
Fixes for change introduced by rust-lang/rust#23860
Logically,
Copy: Clone
makes sense, sinceCopy
basically means "I can clone this with just memcpy". This also means that one can start out with aCopy
bound and relax it to aClone
bound.This is a [breaking-change] because one must change
#[derive(Copy)]
to#[derive(Copy,Clone)]
. In some cases, deriving doesn't create a proper clone impl (notably around fixed-length arrays), in which case you should write one by hand. Because the type in question isCopy
, this is very simple:Fixes #23790.
r? @aturon (stabilization issue)