@@ -503,34 +503,62 @@ fn place_projection_conflict<'tcx>(
503
503
Overlap :: Disjoint
504
504
}
505
505
}
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
+ }
506
522
( ProjectionElem :: ConstantIndex { offset, min_length : _, from_end : false } ,
507
523
ProjectionElem :: Subslice { from, .. } )
508
524
| ( ProjectionElem :: Subslice { from, .. } ,
509
525
ProjectionElem :: ConstantIndex { offset, min_length : _, from_end : false } ) => {
510
526
if offset >= from {
511
527
debug ! (
512
- "place_element_conflict: DISJOINT-OR-EQ-ARRAY -CONSTANT-INDEX-SUBSLICE" ) ;
528
+ "place_element_conflict: DISJOINT-OR-EQ-SLICE -CONSTANT-INDEX-SUBSLICE" ) ;
513
529
Overlap :: EqualOrDisjoint
514
530
} else {
515
- debug ! ( "place_element_conflict: DISJOINT-ARRAY -CONSTANT-INDEX-SUBSLICE" ) ;
531
+ debug ! ( "place_element_conflict: DISJOINT-SLICE -CONSTANT-INDEX-SUBSLICE" ) ;
516
532
Overlap :: Disjoint
517
533
}
518
534
}
519
535
( 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 , .. } ,
522
538
ProjectionElem :: ConstantIndex { offset, min_length : _, from_end : true } ) => {
523
539
if offset > to {
524
540
debug ! ( "place_element_conflict: \
525
- DISJOINT-OR-EQ-ARRAY -CONSTANT-INDEX-SUBSLICE-FE") ;
541
+ DISJOINT-OR-EQ-SLICE -CONSTANT-INDEX-SUBSLICE-FE") ;
526
542
Overlap :: EqualOrDisjoint
527
543
} 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" ) ;
529
554
Overlap :: Disjoint
555
+ } else {
556
+ debug ! ( "place_element_conflict: DISJOINT-OR-EQ-ARRAY-SUBSLICES" ) ;
557
+ Overlap :: EqualOrDisjoint
530
558
}
531
559
}
532
560
( ProjectionElem :: Subslice { .. } , ProjectionElem :: Subslice { .. } ) => {
533
- debug ! ( "place_element_conflict: DISJOINT-OR-EQ-ARRAY -SUBSLICES" ) ;
561
+ debug ! ( "place_element_conflict: DISJOINT-OR-EQ-SLICE -SUBSLICES" ) ;
534
562
Overlap :: EqualOrDisjoint
535
563
}
536
564
( ProjectionElem :: Deref , _)
0 commit comments