@@ -503,34 +503,62 @@ fn place_projection_conflict<'tcx>(
503503 Overlap :: Disjoint
504504 }
505505 }
506+ (
507+ ProjectionElem :: ConstantIndex { offset, min_length : _, from_end : false } ,
508+ ProjectionElem :: Subslice { from, to, from_end : false }
509+ )
510+ | (
511+ ProjectionElem :: Subslice { from, to, from_end : false } ,
512+ ProjectionElem :: ConstantIndex { offset, min_length : _, from_end : false }
513+ ) => {
514+ if ( from..to) . contains ( & offset) {
515+ debug ! ( "place_element_conflict: DISJOINT-OR-EQ-ARRAY-CONSTANT-INDEX-SUBSLICE" ) ;
516+ Overlap :: EqualOrDisjoint
517+ } else {
518+ debug ! ( "place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX-SUBSLICE" ) ;
519+ Overlap :: Disjoint
520+ }
521+ }
506522 ( ProjectionElem :: ConstantIndex { offset, min_length : _, from_end : false } ,
507523 ProjectionElem :: Subslice { from, .. } )
508524 | ( ProjectionElem :: Subslice { from, .. } ,
509525 ProjectionElem :: ConstantIndex { offset, min_length : _, from_end : false } ) => {
510526 if offset >= from {
511527 debug ! (
512- "place_element_conflict: DISJOINT-OR-EQ-ARRAY -CONSTANT-INDEX-SUBSLICE" ) ;
528+ "place_element_conflict: DISJOINT-OR-EQ-SLICE -CONSTANT-INDEX-SUBSLICE" ) ;
513529 Overlap :: EqualOrDisjoint
514530 } else {
515- debug ! ( "place_element_conflict: DISJOINT-ARRAY -CONSTANT-INDEX-SUBSLICE" ) ;
531+ debug ! ( "place_element_conflict: DISJOINT-SLICE -CONSTANT-INDEX-SUBSLICE" ) ;
516532 Overlap :: Disjoint
517533 }
518534 }
519535 ( ProjectionElem :: ConstantIndex { offset, min_length : _, from_end : true } ,
520- ProjectionElem :: Subslice { from : _ , to } )
521- | ( ProjectionElem :: Subslice { from : _ , to } ,
536+ ProjectionElem :: Subslice { to , .. } )
537+ | ( ProjectionElem :: Subslice { to , .. } ,
522538 ProjectionElem :: ConstantIndex { offset, min_length : _, from_end : true } ) => {
523539 if offset > to {
524540 debug ! ( "place_element_conflict: \
525- DISJOINT-OR-EQ-ARRAY -CONSTANT-INDEX-SUBSLICE-FE") ;
541+ DISJOINT-OR-EQ-SLICE -CONSTANT-INDEX-SUBSLICE-FE") ;
526542 Overlap :: EqualOrDisjoint
527543 } else {
528- debug ! ( "place_element_conflict: DISJOINT-ARRAY-CONSTANT-INDEX-SUBSLICE-FE" ) ;
544+ debug ! ( "place_element_conflict: DISJOINT-SLICE-CONSTANT-INDEX-SUBSLICE-FE" ) ;
545+ Overlap :: Disjoint
546+ }
547+ }
548+ (
549+ ProjectionElem :: Subslice { from : f1, to : t1, from_end : false } ,
550+ ProjectionElem :: Subslice { from : f2, to : t2, from_end : false }
551+ ) => {
552+ if f2 >= t1 || f1 >= t2 {
553+ debug ! ( "place_element_conflict: DISJOINT-ARRAY-SUBSLICES" ) ;
529554 Overlap :: Disjoint
555+ } else {
556+ debug ! ( "place_element_conflict: DISJOINT-OR-EQ-ARRAY-SUBSLICES" ) ;
557+ Overlap :: EqualOrDisjoint
530558 }
531559 }
532560 ( ProjectionElem :: Subslice { .. } , ProjectionElem :: Subslice { .. } ) => {
533- debug ! ( "place_element_conflict: DISJOINT-OR-EQ-ARRAY -SUBSLICES" ) ;
561+ debug ! ( "place_element_conflict: DISJOINT-OR-EQ-SLICE -SUBSLICES" ) ;
534562 Overlap :: EqualOrDisjoint
535563 }
536564 ( ProjectionElem :: Deref , _)
0 commit comments