make_integrate_local takes Local by value
This commit is contained in:
parent
4a86c55f56
commit
10b19f6dee
1 changed files with 4 additions and 4 deletions
|
@ -640,8 +640,8 @@ impl<'a, 'tcx> Integrator<'a, 'tcx> {
|
||||||
new
|
new
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_integrate_local(&self, local: &Local) -> Local {
|
fn make_integrate_local(&self, local: Local) -> Local {
|
||||||
if *local == RETURN_PLACE {
|
if local == RETURN_PLACE {
|
||||||
return self.destination.local;
|
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) {
|
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) {
|
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>> {
|
fn process_projection_elem(&mut self, elem: &PlaceElem<'tcx>) -> Option<PlaceElem<'tcx>> {
|
||||||
if let PlaceElem::Index(local) = elem {
|
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 {
|
if new_local != *local {
|
||||||
return Some(PlaceElem::Index(new_local));
|
return Some(PlaceElem::Index(new_local));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue