From f965b79ccff2beadb52b817c67f56984e9e29112 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Mon, 28 May 2018 09:52:53 -0400 Subject: [PATCH] rewrite the hasher to not access `depth` field Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com> --- src/librustc/ich/impls_ty.rs | 10 +++------- src/librustc/ty/sty.rs | 4 ++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/librustc/ich/impls_ty.rs b/src/librustc/ich/impls_ty.rs index 0f8926c6f44..04e57883c77 100644 --- a/src/librustc/ich/impls_ty.rs +++ b/src/librustc/ich/impls_ty.rs @@ -104,16 +104,16 @@ for ty::RegionKind { c.hash_stable(hcx, hasher); } ty::ReLateBound(db, ty::BrAnon(i)) => { - db.depth.hash_stable(hcx, hasher); + db.hash_stable(hcx, hasher); i.hash_stable(hcx, hasher); } ty::ReLateBound(db, ty::BrNamed(def_id, name)) => { - db.depth.hash_stable(hcx, hasher); + db.hash_stable(hcx, hasher); def_id.hash_stable(hcx, hasher); name.hash_stable(hcx, hasher); } ty::ReLateBound(db, ty::BrEnv) => { - db.depth.hash_stable(hcx, hasher); + db.hash_stable(hcx, hasher); } ty::ReEarlyBound(ty::EarlyBoundRegion { def_id, index, name }) => { def_id.hash_stable(hcx, hasher); @@ -821,10 +821,6 @@ impl_stable_hash_for!(enum ::middle::resolve_lifetime::Region { Free(call_site_scope_data, decl) }); -impl_stable_hash_for!(struct ty::DebruijnIndex { - depth -}); - impl_stable_hash_for!(enum ty::cast::CastKind { CoercionCast, PtrPtrCast, diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index 8e2c611d841..275540b9efe 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -1319,6 +1319,10 @@ impl DebruijnIndex { } } +impl_stable_hash_for!(struct DebruijnIndex { + depth +}); + /// Region utilities impl RegionKind { pub fn is_late_bound(&self) -> bool {