@@ -250,6 +250,7 @@ fn place_components_conflict<'tcx>(
250
250
| ( ProjectionElem :: Index { .. } , _, _)
251
251
| ( ProjectionElem :: ConstantIndex { .. } , _, _)
252
252
| ( ProjectionElem :: Subslice { .. } , _, _)
253
+ | ( ProjectionElem :: OpaqueCast { .. } , _, _)
253
254
| ( ProjectionElem :: Downcast { .. } , _, _) => {
254
255
// Recursive case. This can still be disjoint on a
255
256
// further iteration if this a shallow access and
@@ -317,6 +318,17 @@ fn place_projection_conflict<'tcx>(
317
318
debug ! ( "place_element_conflict: DISJOINT-OR-EQ-DEREF" ) ;
318
319
Overlap :: EqualOrDisjoint
319
320
}
321
+ ( ProjectionElem :: OpaqueCast ( v1) , ProjectionElem :: OpaqueCast ( v2) ) => {
322
+ if v1 == v2 {
323
+ // same type - recur.
324
+ debug ! ( "place_element_conflict: DISJOINT-OR-EQ-OPAQUE" ) ;
325
+ Overlap :: EqualOrDisjoint
326
+ } else {
327
+ // Different types. Disjoint!
328
+ debug ! ( "place_element_conflict: DISJOINT-OPAQUE" ) ;
329
+ Overlap :: Disjoint
330
+ }
331
+ }
320
332
( ProjectionElem :: Field ( f1, _) , ProjectionElem :: Field ( f2, _) ) => {
321
333
if f1 == f2 {
322
334
// same field (e.g., `a.y` vs. `a.y`) - recur.
@@ -520,6 +532,7 @@ fn place_projection_conflict<'tcx>(
520
532
| ProjectionElem :: Field ( ..)
521
533
| ProjectionElem :: Index ( ..)
522
534
| ProjectionElem :: ConstantIndex { .. }
535
+ | ProjectionElem :: OpaqueCast { .. }
523
536
| ProjectionElem :: Subslice { .. }
524
537
| ProjectionElem :: Downcast ( ..) ,
525
538
_,
0 commit comments