Closed
Description
Right now any struct that contains only implicitly copyable types is implicitly copyable and there is no way to turn this off.
We need a way to annotate that a struct should not be implicitly copyable at the very least.
I think a better solution would to make the default not to have structs be implicitly copyable unless annotated specifically that they are. That is, the default would be reversed.
This is an issue for things like Option where T is implicitly copyable. It completely changes the semantics of functions like unwrap()
. Depending on the type of T, this may move or copy.
This recently caused a Servo bug where the different between unwrap()
and with_mut_ref()
caused an infinite loop: