Skip to content

Commit 9a558b6

Browse files
authored
Rollup merge of #104773 - oli-obk:overlap, r=lcnr
OpaqueCast projections are always overlapping, they can't possibly be disjoint r? ``@lcnr``
2 parents 0e4eb0d + 46b37e2 commit 9a558b6

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

compiler/rustc_borrowck/src/places_conflict.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -320,16 +320,10 @@ fn place_projection_conflict<'tcx>(
320320
debug!("place_element_conflict: DISJOINT-OR-EQ-DEREF");
321321
Overlap::EqualOrDisjoint
322322
}
323-
(ProjectionElem::OpaqueCast(v1), ProjectionElem::OpaqueCast(v2)) => {
324-
if v1 == v2 {
325-
// same type - recur.
326-
debug!("place_element_conflict: DISJOINT-OR-EQ-OPAQUE");
327-
Overlap::EqualOrDisjoint
328-
} else {
329-
// Different types. Disjoint!
330-
debug!("place_element_conflict: DISJOINT-OPAQUE");
331-
Overlap::Disjoint
332-
}
323+
(ProjectionElem::OpaqueCast(_), ProjectionElem::OpaqueCast(_)) => {
324+
// casts to other types may always conflict irrespective of the type being cast to.
325+
debug!("place_element_conflict: DISJOINT-OR-EQ-OPAQUE");
326+
Overlap::EqualOrDisjoint
333327
}
334328
(ProjectionElem::Field(f1, _), ProjectionElem::Field(f2, _)) => {
335329
if f1 == f2 {

0 commit comments

Comments
 (0)