Skip to main content

hash_map_wf

Function hash_map_wf 

Source
pub uninterp spec fn hash_map_wf<Key, Value, S, A: Allocator>(
    m: &HashMap<Key, Value, S, A>,
) -> bool
Expand description

Whether each of the map’s entries is stored where its key’s hash says, so that the map’s view describes what its operations do. The specified operations build well-formed maps, and keep a map well formed. Safe code can build malformed maps, though: for example by cloning a map whose key type’s Clone changes the key (see obeys_clone_eq; the copy keeps each changed key in the original’s bucket). So a map from unverified code is not known to be well formed.

This depends on the map value, not only its view: a malformed copy can have the same view as the well-formed original.