External Publication
Visit Post

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

Rust Internals [Unofficial] June 5, 2026
Source

quinedot:

I think making macros be conditional on trait solving is a big ask. Especially since which traits are dependent on macro output.

I meant a pure syntactic solution, based on syntax heuristics. False positives would result in this feature not working in some rare cases.

chrefr:

this will be a big change, hurt performance and incrementality

Makes sense. So the syntax based solution is probably not a good idea.

What about doing this in the trait solver, but not with completely solving and relying on specialization? Trait solver needs to collect all trait impls from the crate. If it sees a #[ignorable] impl Clone for Foo<Something> and another impl Clone for Foo<Another> or impl Clone for T, it ignores the #[ignorable] one.

Discussion in the ATmosphere

Loading comments...