diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2020-01-14 01:26:11 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2020-01-28 10:12:53 -0300 |
| commit | 10b19f6deec72765c5f28420c80b1e86f2536b7b (patch) | |
| tree | c79433d74c02218c61841f81f1b2a3dc5226259c | |
| parent | 4a86c55f566753aea8f3199a7caa93ffdd7a9a86 (diff) | |
| download | rust-10b19f6deec72765c5f28420c80b1e86f2536b7b.tar.gz rust-10b19f6deec72765c5f28420c80b1e86f2536b7b.zip | |
make_integrate_local takes Local by value
| -rw-r--r-- | src/librustc_mir/transform/inline.rs | 8 |
1 files 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<PlaceElem<'tcx>> { 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)); |
