Skip to content

Commit

Permalink
Address review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Mar 22, 2017
1 parent 03b8091 commit 45deab4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/librustc/ty/util.rs
Expand Up @@ -513,7 +513,9 @@ impl<'a, 'gcx, 'tcx, W> TypeVisitor<'tcx> for TypeIdHasher<'a, 'gcx, 'tcx, W>
match *r {
ty::ReErased |
ty::ReStatic |
ty::ReEmpty => {}
ty::ReEmpty => {
// No variant fields to hash for these ...
}
ty::ReLateBound(db, ty::BrAnon(i)) => {
self.hash(db.depth);
self.hash(i);
Expand Down
13 changes: 11 additions & 2 deletions src/librustc_mir/transform/erase_regions.rs
Expand Up @@ -45,8 +45,17 @@ impl<'a, 'tcx> MutVisitor<'tcx> for EraseRegionsVisitor<'a, 'tcx> {
Rvalue::Ref(ref mut r, _, _) => {
*r = self.tcx.mk_region(ReErased);
}
_ => {
/* only the above variant contains regions */
Rvalue::Use(..) |
Rvalue::Repeat(..) |
Rvalue::Len(..) |
Rvalue::Cast(..) |
Rvalue::BinaryOp(..) |
Rvalue::CheckedBinaryOp(..) |
Rvalue::UnaryOp(..) |
Rvalue::Discriminant(..) |
Rvalue::Box(..) |
Rvalue::Aggregate(..) => {
// These variants don't contain regions.
}
}
self.super_rvalue(rvalue, location);
Expand Down

0 comments on commit 45deab4

Please sign in to comment.