Indirect places can only appear as first projection in runtime MIR.
This commit is contained in:
parent
a0b4d6dfb8
commit
95986dd279
1 changed files with 1 additions and 1 deletions
|
@ -671,7 +671,7 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
||||||
fn simplify_place_projection(&mut self, place: &mut Place<'tcx>, location: Location) {
|
fn simplify_place_projection(&mut self, place: &mut Place<'tcx>, location: Location) {
|
||||||
// If the projection is indirect, we treat the local as a value, so can replace it with
|
// If the projection is indirect, we treat the local as a value, so can replace it with
|
||||||
// another local.
|
// another local.
|
||||||
if place.is_indirect()
|
if place.is_indirect_first_projection()
|
||||||
&& let Some(base) = self.locals[place.local]
|
&& let Some(base) = self.locals[place.local]
|
||||||
&& let Some(new_local) = self.try_as_local(base, location)
|
&& let Some(new_local) = self.try_as_local(base, location)
|
||||||
&& place.local != new_local
|
&& place.local != new_local
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue