From 10b19f6deec72765c5f28420c80b1e86f2536b7b Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 14 Jan 2020 01:26:11 -0300 Subject: [PATCH] make_integrate_local takes Local by value --- src/librustc_mir/transform/inline.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/librustc_mir/transform/inline.rs b/src/librustc_mir/transform/inline.rs index 96cd8fc1354..56b6fa68e18 100644 --- a/src/librustc_mir/transform/inline.rs +++ b/src/librustc_mir/transform/inline.rs @@ -640,8 +640,8 @@ impl<'a, 'tcx> Integrator<'a, 'tcx> { new } - fn make_integrate_local(&self, local: &Local) -> Local { - if *local == RETURN_PLACE { + fn make_integrate_local(&self, local: Local) -> Local { + if local == RETURN_PLACE { return self.destination.local; } @@ -660,7 +660,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for Integrator<'a, 'tcx> { } fn visit_local(&mut self, local: &mut Local, _ctxt: PlaceContext, _location: Location) { - *local = self.make_integrate_local(local); + *local = self.make_integrate_local(*local); } fn visit_place(&mut self, place: &mut Place<'tcx>, context: PlaceContext, location: Location) { @@ -680,7 +680,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for Integrator<'a, 'tcx> { fn process_projection_elem(&mut self, elem: &PlaceElem<'tcx>) -> Option> { if let PlaceElem::Index(local) = elem { - let new_local = self.make_integrate_local(local); + let new_local = self.make_integrate_local(*local); if new_local != *local { return Some(PlaceElem::Index(new_local));