about summary refs log tree commit diff
path: root/src/librustc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-08-25 08:06:06 +0000
committerbors <bors@rust-lang.org>2019-08-25 08:06:06 +0000
commitd760df5aea483aae041c9a241e7acacf48f75035 (patch)
treec0603f6587332849ebbcdbffe57b7f7917bc81d9 /src/librustc
parent783469ca09005d135c3204a55069707d1cd705a9 (diff)
parent53f47347941de87dff536f3875f0a62a7fda4459 (diff)
downloadrust-d760df5aea483aae041c9a241e7acacf48f75035.tar.gz
rust-d760df5aea483aae041c9a241e7acacf48f75035.zip
Auto merge of #63874 - spastorino:places-drive-by-cleanups, r=Centril
Places drive by cleanups

Small fixes of things meanwhile I was doing the box part of Place 2.0, based on @centril reviews.
Diffstat (limited to 'src/librustc')
-rw-r--r--src/librustc/mir/mod.rs6
-rw-r--r--src/librustc/mir/visit.rs11
2 files changed, 7 insertions, 10 deletions
diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs
index 11701a66377..654d3d780fc 100644
--- a/src/librustc/mir/mod.rs
+++ b/src/librustc/mir/mod.rs
@@ -1555,7 +1555,7 @@ pub struct Statement<'tcx> {
 #[cfg(target_arch = "x86_64")]
 static_assert_size!(Statement<'_>, 56);
 
-impl<'tcx> Statement<'tcx> {
+impl Statement<'_> {
     /// Changes a statement to a nop. This is both faster than deleting instructions and avoids
     /// invalidating statement indices in `Location`s.
     pub fn make_nop(&mut self) {
@@ -1677,7 +1677,7 @@ pub struct InlineAsm<'tcx> {
     pub inputs: Box<[(Span, Operand<'tcx>)]>,
 }
 
-impl<'tcx> Debug for Statement<'tcx> {
+impl Debug for Statement<'_> {
     fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         use self::StatementKind::*;
         match self.kind {
@@ -2047,7 +2047,7 @@ impl<'p, 'tcx> Iterator for ProjectionsIter<'p, 'tcx> {
 
 impl<'p, 'tcx> FusedIterator for ProjectionsIter<'p, 'tcx> {}
 
-impl<'tcx> Debug for Place<'tcx> {
+impl Debug for Place<'_> {
     fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         self.iterate(|_place_base, place_projections| {
             // FIXME: remove this collect once we have migrated to slices
diff --git a/src/librustc/mir/visit.rs b/src/librustc/mir/visit.rs
index 2d16e7bcc83..24420cb4d7e 100644
--- a/src/librustc/mir/visit.rs
+++ b/src/librustc/mir/visit.rs
@@ -724,10 +724,6 @@ macro_rules! make_mir_visitor {
                 }
 
                 match & $($mutability)? proj.elem {
-                    ProjectionElem::Deref => {
-                    }
-                    ProjectionElem::Subslice { from: _, to: _ } => {
-                    }
                     ProjectionElem::Field(_field, ty) => {
                         self.visit_ty(ty, TyContext::Location(location));
                     }
@@ -738,11 +734,12 @@ macro_rules! make_mir_visitor {
                             location
                         );
                     }
+                    ProjectionElem::Deref |
+                    ProjectionElem::Subslice { from: _, to: _ } |
                     ProjectionElem::ConstantIndex { offset: _,
                                                     min_length: _,
-                                                    from_end: _ } => {
-                    }
-                    ProjectionElem::Downcast(_name, _variant_index) => {
+                                                    from_end: _ } |
+                    ProjectionElem::Downcast(_, _) => {
                     }
                 }
             }