From 59c063302f3ce8e3020a94183c1cf4f203119ab2 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 24 Aug 2019 14:16:56 -0700 Subject: [PATCH 1/3] Allow lifetime parameters to be inferred --- src/librustc/mir/mod.rs | 6 +++--- src/librustc_mir/dataflow/move_paths/mod.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index 11701a6637744..654d3d780fcb2 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/dataflow/move_paths/mod.rs b/src/librustc_mir/dataflow/move_paths/mod.rs index 5c2255882b2c7..e5a19572170a7 100644 --- a/src/librustc_mir/dataflow/move_paths/mod.rs +++ b/src/librustc_mir/dataflow/move_paths/mod.rs @@ -240,7 +240,7 @@ impl MovePathLookup { // alternative will *not* create a MovePath on the fly for an // unknown place, but will rather return the nearest available // parent. - pub fn find(&self, place_ref: PlaceRef<'cx, 'tcx>) -> LookupResult { + pub fn find(&self, place_ref: PlaceRef<'_, '_>) -> LookupResult { place_ref.iterate(|place_base, place_projection| { let mut result = match place_base { PlaceBase::Local(local) => self.locals[*local], From 717e8a5219c491d0e8e865cc6abafc6fce6c4dff Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 24 Aug 2019 14:19:32 -0700 Subject: [PATCH 2/3] Join arms patterns, body is empty in all arms --- src/librustc/mir/visit.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/librustc/mir/visit.rs b/src/librustc/mir/visit.rs index 2d16e7bcc8371..24420cb4d7e91 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(_, _) => { } } } From 53f47347941de87dff536f3875f0a62a7fda4459 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 24 Aug 2019 15:26:25 -0700 Subject: [PATCH 3/3] Add a period at the end of the sentence --- src/librustc_mir/borrow_check/prefixes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_mir/borrow_check/prefixes.rs b/src/librustc_mir/borrow_check/prefixes.rs index ecafd4eb1157e..4c6be23de28be 100644 --- a/src/librustc_mir/borrow_check/prefixes.rs +++ b/src/librustc_mir/borrow_check/prefixes.rs @@ -136,7 +136,7 @@ impl<'cx, 'tcx> Iterator for Prefixes<'cx, 'tcx> { } PrefixSet::All => { // all prefixes: just blindly enqueue the base - // of the projection + // of the projection. self.next = Some(PlaceRef { base: cursor.base, projection: &proj.base,