@@ -871,12 +871,14 @@ impl<Cx: PatCx> PlaceInfo<Cx> {
871
871
where
872
872
Cx : ' a ,
873
873
{
874
+ debug ! ( ?self . ty) ;
874
875
if self . private_uninhabited {
875
876
// Skip the whole column
876
877
return Ok ( ( smallvec ! [ Constructor :: PrivateUninhabited ] , vec ! [ ] ) ) ;
877
878
}
878
879
879
880
let ctors_for_ty = cx. ctors_for_ty ( & self . ty ) ?;
881
+ debug ! ( ?ctors_for_ty) ;
880
882
881
883
// We treat match scrutinees of type `!` or `EmptyEnum` differently.
882
884
let is_toplevel_exception =
@@ -895,6 +897,7 @@ impl<Cx: PatCx> PlaceInfo<Cx> {
895
897
896
898
// Analyze the constructors present in this column.
897
899
let mut split_set = ctors_for_ty. split ( ctors) ;
900
+ debug ! ( ?split_set) ;
898
901
let all_missing = split_set. present . is_empty ( ) ;
899
902
900
903
// 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> {
1254
1257
/// + true + [Second(true)] +
1255
1258
/// + false + [_] +
1256
1259
/// + _ + [_, _, tail @ ..] +
1257
- /// | ✓ | ? | // column validity
1260
+ /// | ✓ | ? | // validity
1258
1261
/// ```
1259
1262
impl < ' p , Cx : PatCx > fmt:: Debug for Matrix < ' p , Cx > {
1260
1263
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -1285,7 +1288,7 @@ impl<'p, Cx: PatCx> fmt::Debug for Matrix<'p, Cx> {
1285
1288
write ! ( f, " {sep}" ) ?;
1286
1289
}
1287
1290
if is_validity_row {
1288
- write ! ( f, " // column validity" ) ?;
1291
+ write ! ( f, " // validity" ) ?;
1289
1292
}
1290
1293
write ! ( f, "\n " ) ?;
1291
1294
}
@@ -1617,7 +1620,6 @@ fn compute_exhaustiveness_and_usefulness<'a, 'p, Cx: PatCx>(
1617
1620
} ;
1618
1621
1619
1622
// Analyze the constructors present in this column.
1620
- debug ! ( "ty: {:?}" , place. ty) ;
1621
1623
let ctors = matrix. heads ( ) . map ( |p| p. ctor ( ) ) ;
1622
1624
let ( split_ctors, missing_ctors) = place. split_column_ctors ( mcx. tycx , ctors) ?;
1623
1625
@@ -1669,7 +1671,10 @@ fn compute_exhaustiveness_and_usefulness<'a, 'p, Cx: PatCx>(
1669
1671
for row in matrix. rows ( ) {
1670
1672
if row. useful {
1671
1673
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
+ }
1673
1678
}
1674
1679
}
1675
1680
}
@@ -1768,6 +1773,7 @@ pub fn compute_match_usefulness<'p, Cx: PatCx>(
1768
1773
. map ( |arm| {
1769
1774
debug ! ( ?arm) ;
1770
1775
let usefulness = collect_pattern_usefulness ( & cx. useful_subpatterns , arm. pat ) ;
1776
+ debug ! ( ?usefulness) ;
1771
1777
( arm, usefulness)
1772
1778
} )
1773
1779
. collect ( ) ;
0 commit comments