@@ -844,8 +844,8 @@ impl<'tcx> Constructor<'tcx> {
844
844
}
845
845
846
846
/// Faster version of `is_covered_by` when applied to many constructors. `used_ctors` is
847
- /// assumed to be built from `matrix.head_ctors()` with wildcards filtered out, and `self` is
848
- /// assumed to have been split from a wildcard.
847
+ /// assumed to be built from `matrix.head_ctors()` with wildcards and opaques filtered out,
848
+ /// and `self` is assumed to have been split from a wildcard.
849
849
fn is_covered_by_any < ' p > (
850
850
& self ,
851
851
pcx : & PatCtxt < ' _ , ' p , ' tcx > ,
@@ -894,7 +894,7 @@ impl<'tcx> Constructor<'tcx> {
894
894
/// in `to_ctors`: in some cases we only return `Missing`.
895
895
#[ derive( Debug ) ]
896
896
pub ( super ) struct SplitWildcard < ' tcx > {
897
- /// Constructors seen in the matrix.
897
+ /// Constructors (other than wildcards and opaques) seen in the matrix.
898
898
matrix_ctors : Vec < Constructor < ' tcx > > ,
899
899
/// All the constructors for this type
900
900
all_ctors : SmallVec < [ Constructor < ' tcx > ; 1 ] > ,
@@ -1037,7 +1037,7 @@ impl<'tcx> SplitWildcard<'tcx> {
1037
1037
// Since `all_ctors` never contains wildcards, this won't recurse further.
1038
1038
self . all_ctors =
1039
1039
self . all_ctors . iter ( ) . flat_map ( |ctor| ctor. split ( pcx, ctors. clone ( ) ) ) . collect ( ) ;
1040
- self . matrix_ctors = ctors. filter ( |c| !c . is_wildcard ( ) ) . cloned ( ) . collect ( ) ;
1040
+ self . matrix_ctors = ctors. filter ( |c| !matches ! ( c , Wildcard | Opaque ) ) . cloned ( ) . collect ( ) ;
1041
1041
}
1042
1042
1043
1043
/// Whether there are any value constructors for this type that are not present in the matrix.
0 commit comments