@@ -844,8 +844,8 @@ impl<'tcx> Constructor<'tcx> {
844844 }
845845
846846 /// 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.
849849 fn is_covered_by_any < ' p > (
850850 & self ,
851851 pcx : & PatCtxt < ' _ , ' p , ' tcx > ,
@@ -894,7 +894,7 @@ impl<'tcx> Constructor<'tcx> {
894894/// in `to_ctors`: in some cases we only return `Missing`.
895895#[ derive( Debug ) ]
896896pub ( super ) struct SplitWildcard < ' tcx > {
897- /// Constructors seen in the matrix.
897+ /// Constructors (other than wildcards and opaques) seen in the matrix.
898898 matrix_ctors : Vec < Constructor < ' tcx > > ,
899899 /// All the constructors for this type
900900 all_ctors : SmallVec < [ Constructor < ' tcx > ; 1 ] > ,
@@ -1037,7 +1037,7 @@ impl<'tcx> SplitWildcard<'tcx> {
10371037 // Since `all_ctors` never contains wildcards, this won't recurse further.
10381038 self . all_ctors =
10391039 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 ( ) ;
10411041 }
10421042
10431043 /// Whether there are any value constructors for this type that are not present in the matrix.
0 commit comments