{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreihjtpi7ewllrucizii7fog74ngot3s2v7md2pbao4g6zl735b5lvq",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mnpklvtp77f2"
  },
  "path": "/t/make-derive-copy-enough-for-both-clone-and-copy/24371#post_20",
  "publishedAt": "2026-06-07T15:32:17.000Z",
  "site": "https://internals.rust-lang.org",
  "tags": [
    "Discussion: better derive for trait Eq",
    "language design"
  ],
  "textContent": "I had some discussion before:\n\nDiscussion: better derive for trait Eq language design\n\n> TL;DR adding a new type Derive (as a switch) on Ord, Eq, (and possibly Copy), to indicate whether derive PartialOrd, PartialEq, and Clone for them. By default it is False for compatiability issues, it will become True with some next edition. Since there are not too much things to do, maybe we could just enable it in edition 2024. Considering the following code: use core::cmp::Ordering; #[derive(Ord, PartialEq, Eq)] struct Reversed<T:Ord>(T); impl<T:Ord> PartialOrd for Reversed<T> { fn p…\n\nMaybe adding a new type `DeriveDefault` could be better.\n\nIf you use derive by accident, the duplicated implementation will directly throw an error, and if you just implement traits by hand, you could easily disable the derive flag.",
  "title": "Make `#[derive(Copy)]` enough for both `Clone` and `Copy`"
}