@@ -575,10 +575,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
575
575
fully_matched = true ;
576
576
Some ( variant_index. as_usize ( ) )
577
577
}
578
- ( & TestKind :: Switch { .. } , _) => {
579
- fully_matched = false ;
580
- None
581
- }
582
578
583
579
// If we are performing a switch over integers, then this informs integer
584
580
// equality, but nothing else.
@@ -603,10 +599,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
603
599
options. len ( )
604
600
} )
605
601
}
606
- ( & TestKind :: SwitchInt { .. } , _) => {
607
- fully_matched = false ;
608
- None
609
- }
610
602
611
603
(
612
604
& TestKind :: Len { len : test_len, op : BinOp :: Eq } ,
@@ -673,10 +665,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
673
665
}
674
666
}
675
667
}
676
- ( TestKind :: Len { .. } , _) => {
677
- fully_matched = false ;
678
- None
679
- }
680
668
681
669
( TestKind :: Range ( test) , & TestCase :: Range ( pat) ) => {
682
670
if test. as_ref ( ) == pat {
@@ -699,10 +687,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
699
687
None
700
688
}
701
689
}
702
- ( & TestKind :: Range { .. } , _) => {
703
- fully_matched = false ;
704
- None
705
- }
706
690
707
691
// FIXME(#29623): return `Some(1)` when the values are different.
708
692
( TestKind :: Eq { value : test_val, .. } , TestCase :: Constant { value : case_val } )
@@ -711,7 +695,15 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
711
695
fully_matched = true ;
712
696
Some ( 0 )
713
697
}
714
- ( TestKind :: Eq { .. } , _) => {
698
+
699
+ (
700
+ TestKind :: Switch { .. }
701
+ | TestKind :: SwitchInt { .. }
702
+ | TestKind :: Len { .. }
703
+ | TestKind :: Range { .. }
704
+ | TestKind :: Eq { .. } ,
705
+ _,
706
+ ) => {
715
707
fully_matched = false ;
716
708
None
717
709
}
0 commit comments