Skip to content

Commit

Permalink
rewrite the hasher to not access depth field
Browse files Browse the repository at this point in the history
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
  • Loading branch information
nikomatsakis and csmoe committed May 28, 2018
1 parent e2f7f4a commit f965b79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/librustc/ich/impls_ty.rs
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions src/librustc/ty/sty.rs
Expand Up @@ -1319,6 +1319,10 @@ impl DebruijnIndex {
}
}

impl_stable_hash_for!(struct DebruijnIndex {
depth
});

/// Region utilities
impl RegionKind {
pub fn is_late_bound(&self) -> bool {
Expand Down

0 comments on commit f965b79

Please sign in to comment.