Skip to content

Commit f965b79

Browse files
nikomatsakiscsmoe
andcommitted
rewrite the hasher to not access depth field
Co-authored-by: csmoe <[email protected]>
1 parent e2f7f4a commit f965b79

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/librustc/ich/impls_ty.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,16 @@ for ty::RegionKind {
104104
c.hash_stable(hcx, hasher);
105105
}
106106
ty::ReLateBound(db, ty::BrAnon(i)) => {
107-
db.depth.hash_stable(hcx, hasher);
107+
db.hash_stable(hcx, hasher);
108108
i.hash_stable(hcx, hasher);
109109
}
110110
ty::ReLateBound(db, ty::BrNamed(def_id, name)) => {
111-
db.depth.hash_stable(hcx, hasher);
111+
db.hash_stable(hcx, hasher);
112112
def_id.hash_stable(hcx, hasher);
113113
name.hash_stable(hcx, hasher);
114114
}
115115
ty::ReLateBound(db, ty::BrEnv) => {
116-
db.depth.hash_stable(hcx, hasher);
116+
db.hash_stable(hcx, hasher);
117117
}
118118
ty::ReEarlyBound(ty::EarlyBoundRegion { def_id, index, name }) => {
119119
def_id.hash_stable(hcx, hasher);
@@ -821,10 +821,6 @@ impl_stable_hash_for!(enum ::middle::resolve_lifetime::Region {
821821
Free(call_site_scope_data, decl)
822822
});
823823

824-
impl_stable_hash_for!(struct ty::DebruijnIndex {
825-
depth
826-
});
827-
828824
impl_stable_hash_for!(enum ty::cast::CastKind {
829825
CoercionCast,
830826
PtrPtrCast,

src/librustc/ty/sty.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,10 @@ impl DebruijnIndex {
13191319
}
13201320
}
13211321

1322+
impl_stable_hash_for!(struct DebruijnIndex {
1323+
depth
1324+
});
1325+
13221326
/// Region utilities
13231327
impl RegionKind {
13241328
pub fn is_late_bound(&self) -> bool {

0 commit comments

Comments
 (0)