@@ -871,12 +871,14 @@ impl<Cx: PatCx> PlaceInfo<Cx> {
871871 where
872872 Cx : ' a ,
873873 {
874+ debug ! ( ?self . ty) ;
874875 if self . private_uninhabited {
875876 // Skip the whole column
876877 return Ok ( ( smallvec ! [ Constructor :: PrivateUninhabited ] , vec ! [ ] ) ) ;
877878 }
878879
879880 let ctors_for_ty = cx. ctors_for_ty ( & self . ty ) ?;
881+ debug ! ( ?ctors_for_ty) ;
880882
881883 // We treat match scrutinees of type `!` or `EmptyEnum` differently.
882884 let is_toplevel_exception =
@@ -895,6 +897,7 @@ impl<Cx: PatCx> PlaceInfo<Cx> {
895897
896898 // Analyze the constructors present in this column.
897899 let mut split_set = ctors_for_ty. split ( ctors) ;
900+ debug ! ( ?split_set) ;
898901 let all_missing = split_set. present . is_empty ( ) ;
899902
900903 // Build the set of constructors we will specialize with. It must cover the whole type, so
@@ -1254,7 +1257,7 @@ impl<'p, Cx: PatCx> Matrix<'p, Cx> {
12541257/// + true + [Second(true)] +
12551258/// + false + [_] +
12561259/// + _ + [_, _, tail @ ..] +
1257- /// | ✓ | ? | // column validity
1260+ /// | ✓ | ? | // validity
12581261/// ```
12591262impl < ' p , Cx : PatCx > fmt:: Debug for Matrix < ' p , Cx > {
12601263 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -1285,7 +1288,7 @@ impl<'p, Cx: PatCx> fmt::Debug for Matrix<'p, Cx> {
12851288 write ! ( f, " {sep}" ) ?;
12861289 }
12871290 if is_validity_row {
1288- write ! ( f, " // column validity" ) ?;
1291+ write ! ( f, " // validity" ) ?;
12891292 }
12901293 write ! ( f, "\n " ) ?;
12911294 }
@@ -1617,7 +1620,6 @@ fn compute_exhaustiveness_and_usefulness<'a, 'p, Cx: PatCx>(
16171620 } ;
16181621
16191622 // Analyze the constructors present in this column.
1620- debug ! ( "ty: {:?}" , place. ty) ;
16211623 let ctors = matrix. heads ( ) . map ( |p| p. ctor ( ) ) ;
16221624 let ( split_ctors, missing_ctors) = place. split_column_ctors ( mcx. tycx , ctors) ?;
16231625
@@ -1669,7 +1671,10 @@ fn compute_exhaustiveness_and_usefulness<'a, 'p, Cx: PatCx>(
16691671 for row in matrix. rows ( ) {
16701672 if row. useful {
16711673 if let PatOrWild :: Pat ( pat) = row. head ( ) {
1672- mcx. useful_subpatterns . insert ( pat. uid ) ;
1674+ let newly_useful = mcx. useful_subpatterns . insert ( pat. uid ) ;
1675+ if newly_useful {
1676+ debug ! ( "newly useful: {pat:?}" ) ;
1677+ }
16731678 }
16741679 }
16751680 }
@@ -1768,6 +1773,7 @@ pub fn compute_match_usefulness<'p, Cx: PatCx>(
17681773 . map ( |arm| {
17691774 debug ! ( ?arm) ;
17701775 let usefulness = collect_pattern_usefulness ( & cx. useful_subpatterns , arm. pat ) ;
1776+ debug ! ( ?usefulness) ;
17711777 ( arm, usefulness)
17721778 } )
17731779 . collect ( ) ;
0 commit comments