Skip to content

Commit 45deab4

Browse files
Address review comments.
1 parent 03b8091 commit 45deab4

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/librustc/ty/util.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,9 @@ impl<'a, 'gcx, 'tcx, W> TypeVisitor<'tcx> for TypeIdHasher<'a, 'gcx, 'tcx, W>
513513
match *r {
514514
ty::ReErased |
515515
ty::ReStatic |
516-
ty::ReEmpty => {}
516+
ty::ReEmpty => {
517+
// No variant fields to hash for these ...
518+
}
517519
ty::ReLateBound(db, ty::BrAnon(i)) => {
518520
self.hash(db.depth);
519521
self.hash(i);

src/librustc_mir/transform/erase_regions.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,17 @@ impl<'a, 'tcx> MutVisitor<'tcx> for EraseRegionsVisitor<'a, 'tcx> {
4545
Rvalue::Ref(ref mut r, _, _) => {
4646
*r = self.tcx.mk_region(ReErased);
4747
}
48-
_ => {
49-
/* only the above variant contains regions */
48+
Rvalue::Use(..) |
49+
Rvalue::Repeat(..) |
50+
Rvalue::Len(..) |
51+
Rvalue::Cast(..) |
52+
Rvalue::BinaryOp(..) |
53+
Rvalue::CheckedBinaryOp(..) |
54+
Rvalue::UnaryOp(..) |
55+
Rvalue::Discriminant(..) |
56+
Rvalue::Box(..) |
57+
Rvalue::Aggregate(..) => {
58+
// These variants don't contain regions.
5059
}
5160
}
5261
self.super_rvalue(rvalue, location);

0 commit comments

Comments
 (0)