Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make_integrate_local takes Local by value
  • Loading branch information
spastorino committed Jan 28, 2020
1 parent 4a86c55 commit 10b19f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustc_mir/transform/inline.rs
Expand Up @@ -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;
}

Expand All @@ -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) {
Expand All @@ -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));
Expand Down

0 comments on commit 10b19f6

Please sign in to comment.