Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 3dc9956

Browse files
committed
Indirect places can only appear as first projection in runtime MIR.
1 parent e5f270a commit 3dc9956

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
@@ -669,7 +669,7 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
669669
fn simplify_place_projection(&mut self, place: &mut Place<'tcx>, location: Location) {
670670
// If the projection is indirect, we treat the local as a value, so can replace it with
671671
// another local.
672-
if place.is_indirect()
672+
if place.is_indirect_first_projection()
673673
&& let Some(base) = self.locals[place.local]
674674
&& let Some(new_local) = self.try_as_local(base, location)
675675
&& place.local != new_local

0 commit comments

Comments
 (0)