@@ -723,7 +723,7 @@ impl<'tcx> Constructor<'tcx> {
723
723
/// this checks for inclusion.
724
724
// We inline because this has a single call site in `Matrix::specialize_constructor`.
725
725
#[ inline]
726
- pub ( super ) fn is_covered_by < ' p > ( & self , pcx : & PatCtxt < ' _ , ' p , ' tcx > , other : & Self ) -> bool {
726
+ pub ( super ) fn is_covered_by ( & self , other : & Self ) -> bool {
727
727
// This must be compatible with `ConstructorSet::split`.
728
728
match ( self , other) {
729
729
// Wildcards cover anything
@@ -763,12 +763,7 @@ impl<'tcx> Constructor<'tcx> {
763
763
( Opaque ( self_id) , Opaque ( other_id) ) => self_id == other_id,
764
764
( Opaque ( ..) , _) | ( _, Opaque ( ..) ) => false ,
765
765
766
- _ => span_bug ! (
767
- pcx. span,
768
- "trying to compare incompatible constructors {:?} and {:?}" ,
769
- self ,
770
- other
771
- ) ,
766
+ _ => bug ! ( "trying to compare incompatible constructors {:?} and {:?}" , self , other) ,
772
767
}
773
768
}
774
769
}
@@ -1134,9 +1129,8 @@ impl<'p, 'tcx> Fields<'p, 'tcx> {
1134
1129
fn wildcards_from_tys (
1135
1130
cx : & MatchCheckCtxt < ' p , ' tcx > ,
1136
1131
tys : impl IntoIterator < Item = Ty < ' tcx > > ,
1137
- span : Span ,
1138
1132
) -> Self {
1139
- Fields :: from_iter ( cx, tys. into_iter ( ) . map ( |ty| DeconstructedPat :: wildcard ( ty, span ) ) )
1133
+ Fields :: from_iter ( cx, tys. into_iter ( ) . map ( |ty| DeconstructedPat :: wildcard ( ty, DUMMY_SP ) ) )
1140
1134
}
1141
1135
1142
1136
// In the cases of either a `#[non_exhaustive]` field list or a non-public field, we hide
@@ -1172,26 +1166,26 @@ impl<'p, 'tcx> Fields<'p, 'tcx> {
1172
1166
pub ( super ) fn wildcards ( pcx : & PatCtxt < ' _ , ' p , ' tcx > , constructor : & Constructor < ' tcx > ) -> Self {
1173
1167
let ret = match constructor {
1174
1168
Single | Variant ( _) => match pcx. ty . kind ( ) {
1175
- ty:: Tuple ( fs) => Fields :: wildcards_from_tys ( pcx. cx , fs. iter ( ) , pcx . span ) ,
1176
- ty:: Ref ( _, rty, _) => Fields :: wildcards_from_tys ( pcx. cx , once ( * rty) , pcx . span ) ,
1169
+ ty:: Tuple ( fs) => Fields :: wildcards_from_tys ( pcx. cx , fs. iter ( ) ) ,
1170
+ ty:: Ref ( _, rty, _) => Fields :: wildcards_from_tys ( pcx. cx , once ( * rty) ) ,
1177
1171
ty:: Adt ( adt, args) => {
1178
1172
if adt. is_box ( ) {
1179
1173
// The only legal patterns of type `Box` (outside `std`) are `_` and box
1180
1174
// patterns. If we're here we can assume this is a box pattern.
1181
- Fields :: wildcards_from_tys ( pcx. cx , once ( args. type_at ( 0 ) ) , pcx . span )
1175
+ Fields :: wildcards_from_tys ( pcx. cx , once ( args. type_at ( 0 ) ) )
1182
1176
} else {
1183
1177
let variant = & adt. variant ( constructor. variant_index_for_adt ( * adt) ) ;
1184
1178
let tys = Fields :: list_variant_nonhidden_fields ( pcx. cx , pcx. ty , variant)
1185
1179
. map ( |( _, ty) | ty) ;
1186
- Fields :: wildcards_from_tys ( pcx. cx , tys, pcx . span )
1180
+ Fields :: wildcards_from_tys ( pcx. cx , tys)
1187
1181
}
1188
1182
}
1189
1183
_ => bug ! ( "Unexpected type for `Single` constructor: {:?}" , pcx) ,
1190
1184
} ,
1191
1185
Slice ( slice) => match * pcx. ty . kind ( ) {
1192
1186
ty:: Slice ( ty) | ty:: Array ( ty, _) => {
1193
1187
let arity = slice. arity ( ) ;
1194
- Fields :: wildcards_from_tys ( pcx. cx , ( 0 ..arity) . map ( |_| ty) , pcx . span )
1188
+ Fields :: wildcards_from_tys ( pcx. cx , ( 0 ..arity) . map ( |_| ty) )
1195
1189
}
1196
1190
_ => bug ! ( "bad slice pattern {:?} {:?}" , constructor, pcx) ,
1197
1191
} ,
@@ -1488,7 +1482,7 @@ impl<'p, 'tcx> DeconstructedPat<'p, 'tcx> {
1488
1482
let wildcard: & _ = pcx
1489
1483
. cx
1490
1484
. pattern_arena
1491
- . alloc ( DeconstructedPat :: wildcard ( inner_ty, pcx . span ) ) ;
1485
+ . alloc ( DeconstructedPat :: wildcard ( inner_ty, DUMMY_SP ) ) ;
1492
1486
let extra_wildcards = other_slice. arity ( ) - self_slice. arity ( ) ;
1493
1487
let extra_wildcards = ( 0 ..extra_wildcards) . map ( |_| wildcard) ;
1494
1488
prefix. iter ( ) . chain ( extra_wildcards) . chain ( suffix) . collect ( )
0 commit comments