@@ -255,6 +255,7 @@ fn place_components_conflict<'tcx>(
255255 | ( ProjectionElem :: Index { .. } , _, _)
256256 | ( ProjectionElem :: ConstantIndex { .. } , _, _)
257257 | ( ProjectionElem :: Subslice { .. } , _, _)
258+ | ( ProjectionElem :: OpaqueCast { .. } , _, _)
258259 | ( ProjectionElem :: Downcast { .. } , _, _) => {
259260 // Recursive case. This can still be disjoint on a
260261 // further iteration if this a shallow access and
@@ -322,6 +323,17 @@ fn place_projection_conflict<'tcx>(
322323 debug ! ( "place_element_conflict: DISJOINT-OR-EQ-DEREF" ) ;
323324 Overlap :: EqualOrDisjoint
324325 }
326+ ( ProjectionElem :: OpaqueCast ( v1) , ProjectionElem :: OpaqueCast ( v2) ) => {
327+ if v1 == v2 {
328+ // same type - recur.
329+ debug ! ( "place_element_conflict: DISJOINT-OR-EQ-OPAQUE" ) ;
330+ Overlap :: EqualOrDisjoint
331+ } else {
332+ // Different types. Disjoint!
333+ debug ! ( "place_element_conflict: DISJOINT-OPAQUE" ) ;
334+ Overlap :: Disjoint
335+ }
336+ }
325337 ( ProjectionElem :: Field ( f1, _) , ProjectionElem :: Field ( f2, _) ) => {
326338 if f1 == f2 {
327339 // same field (e.g., `a.y` vs. `a.y`) - recur.
@@ -525,6 +537,7 @@ fn place_projection_conflict<'tcx>(
525537 | ProjectionElem :: Field ( ..)
526538 | ProjectionElem :: Index ( ..)
527539 | ProjectionElem :: ConstantIndex { .. }
540+ | ProjectionElem :: OpaqueCast { .. }
528541 | ProjectionElem :: Subslice { .. }
529542 | ProjectionElem :: Downcast ( ..) ,
530543 _,
0 commit comments