Skip to main content

obeys_clone_eq

Function obeys_clone_eq 

Source
pub open spec fn obeys_clone_eq<T: Clone>() -> bool
Expand description
{ forall |a: T, b: T| #[trigger] cloned(a, b) ==> a == b }

Whether T::clone returns a value equal to the original.

Integers, bool, char and the Clone impls Verus derives satisfy this. A collection relies on it when it clones its keys: a key that clones to an unequal value can leave the copy holding keys in the wrong order or bucket.