Open
Description
code: https://rust.godbolt.org/z/5M1nnhEbY (godbolt isn't letting me copy it for some reason)
compiler version: 1.85.0
I understand that technically Clone
can have side effects, but standard library types should be able to use some sort of perma-unstable attribute to assert that their Clone
impl does not (technically calling the allocator is an arbitrary side-effect, but i believe rust already has a policy that allocations can be eliminated).
Types that use derive(Clone)
, where all of the fields are pure types, should also have their clone impls marked as safe.