File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
compiler/rustc_mir_transform/src Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -1654,6 +1654,11 @@ impl<'tcx> VnState<'_, 'tcx> {
1654
1654
let place =
1655
1655
Place { local, projection : self . tcx . mk_place_elems ( projection. as_slice ( ) ) } ;
1656
1656
return Some ( place) ;
1657
+ } else if projection. last ( ) == Some ( & PlaceElem :: Deref ) {
1658
+ // `Deref` can only be the first projection in a place.
1659
+ // If we are here, we failed to find a local, and we already have a `Deref`.
1660
+ // Trying to add projections will only result in an ill-formed place.
1661
+ return None ;
1657
1662
} else if let Value :: Projection ( pointer, proj) = * self . get ( index)
1658
1663
&& ( allow_complex_projection || proj. is_stable_offset ( ) )
1659
1664
&& let Some ( proj) = self . try_as_place_elem ( self . ty ( index) , proj, loc)
You can’t perform that action at this time.
0 commit comments