@@ -278,12 +278,12 @@ pub(super) struct Slice {
278
278
279
279
impl Slice {
280
280
fn arity ( self ) -> usize {
281
- unimplemented ! ( )
281
+ match self . _unimplemented { }
282
282
}
283
283
284
284
/// See `Constructor::is_covered_by`
285
285
fn is_covered_by ( self , _other : Self ) -> bool {
286
- unimplemented ! ( ) // never called as Slice contains Void
286
+ match self . _unimplemented { }
287
287
}
288
288
}
289
289
@@ -442,7 +442,7 @@ impl Constructor {
442
442
split_range. split ( int_ranges. cloned ( ) ) ;
443
443
split_range. iter ( ) . map ( IntRange ) . collect ( )
444
444
}
445
- Slice ( _ ) => unimplemented ! ( ) ,
445
+ Slice ( slice ) => match slice . _unimplemented { } ,
446
446
// Any other constructor can be used unchanged.
447
447
_ => smallvec ! [ self . clone( ) ] ,
448
448
}
@@ -465,12 +465,8 @@ impl Constructor {
465
465
( Variant ( self_id) , Variant ( other_id) ) => self_id == other_id,
466
466
467
467
( IntRange ( self_range) , IntRange ( other_range) ) => self_range. is_covered_by ( other_range) ,
468
- ( FloatRange ( ..) , FloatRange ( ..) ) => {
469
- unimplemented ! ( )
470
- }
471
- ( Str ( ..) , Str ( ..) ) => {
472
- unimplemented ! ( )
473
- }
468
+ ( FloatRange ( void) , FloatRange ( ..) ) => match * void { } ,
469
+ ( Str ( void) , Str ( ..) ) => match * void { } ,
474
470
( Slice ( self_slice) , Slice ( other_slice) ) => self_slice. is_covered_by ( * other_slice) ,
475
471
476
472
// We are trying to inspect an opaque constant. Thus we skip the row.
@@ -817,9 +813,7 @@ impl<'p> Fields<'p> {
817
813
Fields :: wildcards_from_tys ( cx, once ( ty. clone ( ) ) )
818
814
}
819
815
} ,
820
- Slice ( ..) => {
821
- unimplemented ! ( )
822
- }
816
+ Slice ( slice) => match slice. _unimplemented { } ,
823
817
Str ( ..)
824
818
| FloatRange ( ..)
825
819
| IntRange ( ..)
@@ -1023,9 +1017,9 @@ impl<'p> DeconstructedPat<'p> {
1023
1017
PatKind :: Wild
1024
1018
}
1025
1019
} ,
1026
- & Slice ( Slice { _unimplemented : _void } ) => unimplemented ! ( ) ,
1027
- & Str ( _void ) => unimplemented ! ( ) ,
1028
- & FloatRange ( _void ) => unimplemented ! ( ) ,
1020
+ & Slice ( slice ) => match slice . _unimplemented { } ,
1021
+ & Str ( void ) => match void { } ,
1022
+ & FloatRange ( void ) => match void { } ,
1029
1023
IntRange ( range) => return range. to_pat ( cx, self . ty . clone ( ) ) ,
1030
1024
Wildcard | NonExhaustive => PatKind :: Wild ,
1031
1025
Missing { .. } => {
@@ -1074,7 +1068,7 @@ impl<'p> DeconstructedPat<'p> {
1074
1068
( Slice ( self_slice) , Slice ( other_slice) )
1075
1069
if self_slice. arity ( ) != other_slice. arity ( ) =>
1076
1070
{
1077
- unimplemented ! ( )
1071
+ match self_slice . _unimplemented { }
1078
1072
}
1079
1073
_ => self . fields . iter_patterns ( ) . collect ( ) ,
1080
1074
}
0 commit comments