External Publication
Visit Post

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

Rust Internals [Unofficial] June 7, 2026
Source

HKalbasi:

It is not just saving 7 letters, it can also improve the codegen for Clone:

The Clone derive already does that, so there is no argument here (there is some order required between the derives, I don't remember which should be above and which below, but if they're on the same line it always works).

HKalbasi:

And if it gets done over an edition, ... and it would no longer need complex compiler features.

Not true, since old editions must still be supported by the compiler.

Discussion in the ATmosphere

Loading comments...