1
Fork 0

Visit type in process_projection_elem.

This commit is contained in:
Camille GILLOT 2021-10-16 14:03:30 +02:00
parent 6d246f0c8d
commit 29b30a9bd2
4 changed files with 6 additions and 60 deletions

View file

@ -316,28 +316,6 @@ impl<'tcx> MutVisitor<'tcx> for Replacer<'tcx> {
}
}
fn process_projection_elem(
&mut self,
elem: PlaceElem<'tcx>,
_: Location,
) -> Option<PlaceElem<'tcx>> {
match elem {
PlaceElem::Index(local) => {
if let Some(replacement) = self.replacements.for_src(local) {
bug!(
"cannot replace {:?} with {:?} in index projection {:?}",
local,
replacement,
elem,
);
} else {
None
}
}
_ => None,
}
}
fn visit_place(&mut self, place: &mut Place<'tcx>, context: PlaceContext, location: Location) {
if let Some(replacement) = self.replacements.for_src(place.local) {
// Rebase `place`s projections onto `replacement`'s.