File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -198,9 +198,11 @@ impl<'tcx> CtxtInterners<'tcx> {
198198 . intern ( kind, |kind| {
199199 let flags = super :: flags:: FlagComputation :: for_kind ( & kind) ;
200200
201- // It's impossible to hash inference regions (and will ICE), so we don't need to try to cache them.
201+ // It's impossible to hash inference variables (and will ICE), so we don't need to try to cache them.
202202 // Without incremental, we rarely stable-hash types, so let's not do it proactively.
203- let stable_hash = if flags. flags . intersects ( TypeFlags :: HAS_RE_INFER )
203+ let stable_hash = if flags
204+ . flags
205+ . intersects ( TypeFlags :: HAS_RE_INFER | TypeFlags :: HAS_TY_INFER )
204206 || sess. opts . incremental . is_none ( )
205207 {
206208 Fingerprint :: ZERO
Original file line number Diff line number Diff line change @@ -675,9 +675,9 @@ impl<CTX> HashStable<CTX> for InferTy {
675675 use InferTy :: * ;
676676 discriminant ( self ) . hash_stable ( ctx, hasher) ;
677677 match self {
678- TyVar ( v ) => v . as_u32 ( ) . hash_stable ( ctx , hasher ) ,
679- IntVar ( v ) => v . index . hash_stable ( ctx , hasher ) ,
680- FloatVar ( v ) => v . index . hash_stable ( ctx , hasher ) ,
678+ TyVar ( _ ) | IntVar ( _ ) | FloatVar ( _ ) => {
679+ panic ! ( "inference variables should not be hashed: {self:?}" )
680+ }
681681 FreshTy ( v) | FreshIntTy ( v) | FreshFloatTy ( v) => v. hash_stable ( ctx, hasher) ,
682682 }
683683 }
Original file line number Diff line number Diff line change @@ -1332,8 +1332,8 @@ where
13321332 RePlaceholder ( p) => {
13331333 p. hash_stable ( hcx, hasher) ;
13341334 }
1335- ReVar ( reg ) => {
1336- reg . hash_stable ( hcx , hasher ) ;
1335+ ReVar ( _ ) => {
1336+ panic ! ( "region variables should not be hashed: {self:?}" )
13371337 }
13381338 }
13391339 }
You can’t perform that action at this time.
0 commit comments