External Publication
Visit Post

Make `#[derive(Copy)]` enough for both `Clone` and `Copy`

Rust Internals [Unofficial] June 5, 2026
Source

PROgrm_JARvis:

Also becoming a potential SemVer hazard

Can you please explain this? I don't see any semver risk here.

PROgrm_JARvis:

taking from Rust's intentional explicitness

Since the Clone is super trait of Copy, this is similar to implied bounds. Do you consider T: Copy instead of T: Clone + Copy a bad thing, reducing the Rust's intentional explicitness?

PROgrm_JARvis:

Also, can't this be implemented as an external crate with some #[derive(Clopy)] to explore the actual usefulness for the ecosystem?

There is a macro_rules_attribute which does this among other things, and also a derive_aliases which is more focused on this problem. We can do an analysis on popularity of this pattern, but it is definitely not a problem invented by me.

Discussion in the ATmosphere

Loading comments...