{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreifz5d3bdo5fywcjspboscv7qayazbr5de6sglitmcor2kwomt5qny",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mniksczfrui2"
},
"path": "/t/make-derive-copy-enough-for-both-clone-and-copy/24371#post_1",
"publishedAt": "2026-06-04T20:41:09.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "Also for `PartialEq` and `Eq`, and `PartialOrd` and `Ord`. This would help in reducing the derive noise on types:\n\n\n // Previously: #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]\n #[derive(Eq, Ord, Copy, Hash)]\n struct Foo {\n x: i32,\n y: i64,\n }\n\n\nThere may be some implementation difficulty about conflicting impls generated by `derive(Copy)` and `derive(Clone)` or manual `Clone` impls. But since these are builtin, the compiler can handle it by using a `#[rustc_interanal_ignore_this_impl_in_presence_of_others]`. We can fix the semantics and emit error about conflicting impls over an edition.",
"title": "Make `#[derive(Copy)]` enough for both `Clone` and `Copy`"
}