File tree 3 files changed +9
-7
lines changed
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> {
198
198
. intern ( kind, |kind| {
199
199
let flags = super :: flags:: FlagComputation :: for_kind ( & kind) ;
200
200
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.
202
202
// 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 )
204
206
|| sess. opts . incremental . is_none ( )
205
207
{
206
208
Fingerprint :: ZERO
Original file line number Diff line number Diff line change @@ -675,9 +675,9 @@ impl<CTX> HashStable<CTX> for InferTy {
675
675
use InferTy :: * ;
676
676
discriminant ( self ) . hash_stable ( ctx, hasher) ;
677
677
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
+ }
681
681
FreshTy ( v) | FreshIntTy ( v) | FreshFloatTy ( v) => v. hash_stable ( ctx, hasher) ,
682
682
}
683
683
}
Original file line number Diff line number Diff line change @@ -1332,8 +1332,8 @@ where
1332
1332
RePlaceholder ( p) => {
1333
1333
p. hash_stable ( hcx, hasher) ;
1334
1334
}
1335
- ReVar ( reg ) => {
1336
- reg . hash_stable ( hcx , hasher ) ;
1335
+ ReVar ( _ ) => {
1336
+ panic ! ( "region variables should not be hashed: {self:?}" )
1337
1337
}
1338
1338
}
1339
1339
}
You can’t perform that action at this time.
0 commit comments