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> {
16541654 let place =
16551655 Place { local, projection : self . tcx . mk_place_elems ( projection. as_slice ( ) ) } ;
16561656 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 ;
16571662 } else if let Value :: Projection ( pointer, proj) = * self . get ( index)
16581663 && ( allow_complex_projection || proj. is_stable_offset ( ) )
16591664 && 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