summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_middle/src/ty/impls_ty.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /compiler/rustc_middle/src/ty/impls_ty.rs
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_middle/src/ty/impls_ty.rs')
-rw-r--r--compiler/rustc_middle/src/ty/impls_ty.rs28
1 files changed, 0 insertions, 28 deletions
diff --git a/compiler/rustc_middle/src/ty/impls_ty.rs b/compiler/rustc_middle/src/ty/impls_ty.rs
index 4c7822acd..02baa395c 100644
--- a/compiler/rustc_middle/src/ty/impls_ty.rs
+++ b/compiler/rustc_middle/src/ty/impls_ty.rs
@@ -73,34 +73,6 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for ty::subst::GenericArg<'t
}
}
-impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for ty::subst::GenericArgKind<'tcx> {
- fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
- match self {
- // WARNING: We dedup cache the `HashStable` results for `List`
- // while ignoring types and freely transmute
- // between `List<Ty<'tcx>>` and `List<GenericArg<'tcx>>`.
- // See `fn mk_type_list` for more details.
- //
- // We therefore hash types without adding a hash for their discriminant.
- //
- // In order to make it very unlikely for the sequence of bytes being hashed for
- // a `GenericArgKind::Type` to be the same as the sequence of bytes being
- // hashed for one of the other variants, we hash some very high number instead
- // of their actual discriminant since `TyKind` should never start with anything
- // that high.
- ty::subst::GenericArgKind::Type(ty) => ty.hash_stable(hcx, hasher),
- ty::subst::GenericArgKind::Const(ct) => {
- 0xF3u8.hash_stable(hcx, hasher);
- ct.hash_stable(hcx, hasher);
- }
- ty::subst::GenericArgKind::Lifetime(lt) => {
- 0xF5u8.hash_stable(hcx, hasher);
- lt.hash_stable(hcx, hasher);
- }
- }
- }
-}
-
// AllocIds get resolved to whatever they point to (to be stable)
impl<'a> HashStable<StableHashingContext<'a>> for mir::interpret::AllocId {
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {