Skip to content

Commit 95986dd

Browse files
committed
Indirect places can only appear as first projection in runtime MIR.
1 parent a0b4d6d commit 95986dd

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_mir_transform/src

1 file changed

+1
-1
lines changed

compiler/rustc_mir_transform/src/gvn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
671671
fn simplify_place_projection(&mut self, place: &mut Place<'tcx>, location: Location) {
672672
// If the projection is indirect, we treat the local as a value, so can replace it with
673673
// another local.
674-
if place.is_indirect()
674+
if place.is_indirect_first_projection()
675675
&& let Some(base) = self.locals[place.local]
676676
&& let Some(new_local) = self.try_as_local(base, location)
677677
&& place.local != new_local

0 commit comments

Comments
 (0)