External Publication
Visit Post

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

Rust Internals [Unofficial] June 7, 2026
Source

HKalbasi:

What do you mean by "the only edition"?

I think they meant to write "the other editions ".

In general an edition barrier cannot be used to change the semantics of the Rust standard library, because that library has to be usable by all editions, especially when code from one edition is talking to code from another edition. I assume this is what chrefr was alluding to.

An argument could probably be made that the idea was merely a syntactic change, not a semantic one. However, I'm pretty sure it's generally considered undesirable for the same source code to silently change meanings across an edition, since even with perfect tooling we can't be 100% sure that all code upgraded to a new edition passed through a particular transformation first. It's much better if the code whose meaning is changing will fail to compile in either the old or the new edition, so that it's impossible to forget to do the transformation. And I don't think there's any way to accomplish that when it comes to implicit derives of standard traits

Discussion in the ATmosphere

Loading comments...