←back to thread

128 points RGBCube | 3 comments | | HN request time: 0.915s | source
1. bloppe ◴[] No.44498108[source]
I don't see how "the hard way" is a breaking change. Anybody got an example of something that works now but wouldn't work after relaxing that constraint?
replies(1): >>44498259 #
2. yuriks ◴[] No.44498259[source]
It relaxes the contract required for an existing type with derive(Clone) to implement Clone, which might allow types in existing code to be cloned where they couldn't before. This might matter if precluding those clones is important for the code, e.g. if there are safety invariants being maintained by Type<T> only being clonable if T is clone.
replies(1): >>44502522 #
3. bloppe ◴[] No.44502522[source]
Ok let's say there's existing code that requires that a type is not Clone. Then that type definitely would not have #[derive(Clone)] applied to it. So it would not be affected by the change. So it would not be broken.

It's only a breaking change if code that previously worked stops working without changing the code.