Visit type in process_projection_elem.
This commit is contained in:
parent
6d246f0c8d
commit
29b30a9bd2
4 changed files with 6 additions and 60 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue