]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_type_ir/src/lib.rs
Use `allow_internal_unstable` and add unstable reason
[rust.git] / compiler / rustc_type_ir / src / lib.rs
index da30344ef7ec090de63092ac9c795f3c1cf42c68..7fbe78aa52353b98968ab4541412c77df925f043 100644 (file)
@@ -675,9 +675,9 @@ fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
         use InferTy::*;
         discriminant(self).hash_stable(ctx, hasher);
         match self {
-            TyVar(v) => v.as_u32().hash_stable(ctx, hasher),
-            IntVar(v) => v.index.hash_stable(ctx, hasher),
-            FloatVar(v) => v.index.hash_stable(ctx, hasher),
+            TyVar(_) | IntVar(_) | FloatVar(_) => {
+                panic!("type variables should not be hashed: {self:?}")
+            }
             FreshTy(v) | FreshIntTy(v) | FreshFloatTy(v) => v.hash_stable(ctx, hasher),
         }
     }