1
Fork 0

Inline move_path_for_projection inside move_path_for

This commit is contained in:
Santiago Pastorino 2019-05-24 00:40:41 +02:00
parent f492693982
commit a0700d062e

View file

@ -101,22 +101,6 @@ impl<'b, 'a, 'gcx, 'tcx> Gatherer<'b, 'a, 'gcx, 'tcx> {
Err(MoveError::cannot_move_out_of(self.loc, Static))
}
Place::Projection(ref proj) => {
self.move_path_for_projection(place, proj)
}
}
}
fn create_move_path(&mut self, place: &Place<'tcx>) {
// This is an non-moving access (such as an overwrite or
// drop), so this not being a valid move path is OK.
let _ = self.move_path_for(place);
}
fn move_path_for_projection(&mut self,
place: &Place<'tcx>,
proj: &Projection<'tcx>)
-> Result<MovePathIndex, MoveError<'tcx>>
{
let base = self.move_path_for(&proj.base)?;
let mir = self.builder.mir;
let tcx = self.builder.tcx;
@ -171,6 +155,14 @@ impl<'b, 'a, 'gcx, 'tcx> Gatherer<'b, 'a, 'gcx, 'tcx> {
}
}
}
}
}
fn create_move_path(&mut self, place: &Place<'tcx>) {
// This is an non-moving access (such as an overwrite or
// drop), so this not being a valid move path is OK.
let _ = self.move_path_for(place);
}
}
impl<'a, 'gcx, 'tcx> MoveDataBuilder<'a, 'gcx, 'tcx> {