@@ -126,7 +126,7 @@ impl fmt::Display for MiriMemoryKind {
126126}
127127
128128/// Pointer provenance.
129- #[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
129+ #[ derive( Debug , Clone , Copy ) ]
130130pub enum Provenance {
131131 Concrete {
132132 alloc_id : AllocId ,
@@ -136,6 +136,24 @@ pub enum Provenance {
136136 Wildcard ,
137137}
138138
139+ // This needs to be `Eq`+`Hash` because the `Machine` trait needs that because validity checking
140+ // *might* be recursive and then it has to track which places have already been visited.
141+ // However, comparing provenance is meaningless, since `Wildcard` might be any provenance -- and of
142+ // course we don't actually do recursive checking.
143+ // We could change `RefTracking` to strip provenance for its `seen` set but that type is generic so that is quite annoying.
144+ // Instead owe add the required instances but make them panic.
145+ impl PartialEq for Provenance {
146+ fn eq ( & self , _other : & Self ) -> bool {
147+ panic ! ( "Provenance must not be compared" )
148+ }
149+ }
150+ impl Eq for Provenance { }
151+ impl std:: hash:: Hash for Provenance {
152+ fn hash < H : std:: hash:: Hasher > ( & self , _state : & mut H ) {
153+ panic ! ( "Provenance must not be hashed" )
154+ }
155+ }
156+
139157/// The "extra" information a pointer has over a regular AllocId.
140158#[ derive( Copy , Clone , PartialEq ) ]
141159pub enum ProvenanceExtra {
0 commit comments