@@ -126,7 +126,7 @@ impl fmt::Display for MiriMemoryKind {
126
126
}
127
127
128
128
/// Pointer provenance.
129
- #[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
129
+ #[ derive( Debug , Clone , Copy ) ]
130
130
pub enum Provenance {
131
131
Concrete {
132
132
alloc_id : AllocId ,
@@ -136,6 +136,24 @@ pub enum Provenance {
136
136
Wildcard ,
137
137
}
138
138
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
+
139
157
/// The "extra" information a pointer has over a regular AllocId.
140
158
#[ derive( Copy , Clone , PartialEq ) ]
141
159
pub enum ProvenanceExtra {
0 commit comments