diff --git a/src/librustc/ty/util.rs b/src/librustc/ty/util.rs index 03db15263b62f..1c1e0d91cb4d6 100644 --- a/src/librustc/ty/util.rs +++ b/src/librustc/ty/util.rs @@ -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); diff --git a/src/librustc_mir/transform/erase_regions.rs b/src/librustc_mir/transform/erase_regions.rs index 07822a5a097ae..0f869e7ed02ff 100644 --- a/src/librustc_mir/transform/erase_regions.rs +++ b/src/librustc_mir/transform/erase_regions.rs @@ -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);