@@ -250,6 +250,7 @@ fn place_components_conflict<'tcx>(
250250 | ( ProjectionElem :: Index { .. } , _, _)
251251 | ( ProjectionElem :: ConstantIndex { .. } , _, _)
252252 | ( ProjectionElem :: Subslice { .. } , _, _)
253+ | ( ProjectionElem :: OpaqueCast { .. } , _, _)
253254 | ( ProjectionElem :: Downcast { .. } , _, _) => {
254255 // Recursive case. This can still be disjoint on a
255256 // further iteration if this a shallow access and
@@ -317,6 +318,17 @@ fn place_projection_conflict<'tcx>(
317318 debug ! ( "place_element_conflict: DISJOINT-OR-EQ-DEREF" ) ;
318319 Overlap :: EqualOrDisjoint
319320 }
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+ }
320332 ( ProjectionElem :: Field ( f1, _) , ProjectionElem :: Field ( f2, _) ) => {
321333 if f1 == f2 {
322334 // same field (e.g., `a.y` vs. `a.y`) - recur.
@@ -520,6 +532,7 @@ fn place_projection_conflict<'tcx>(
520532 | ProjectionElem :: Field ( ..)
521533 | ProjectionElem :: Index ( ..)
522534 | ProjectionElem :: ConstantIndex { .. }
535+ | ProjectionElem :: OpaqueCast { .. }
523536 | ProjectionElem :: Subslice { .. }
524537 | ProjectionElem :: Downcast ( ..) ,
525538 _,
0 commit comments