@@ -938,6 +938,12 @@ struct PatternExtraData<'tcx> {
938
938
ascriptions : Vec < Ascription < ' tcx > > ,
939
939
}
940
940
941
+ impl < ' tcx > PatternExtraData < ' tcx > {
942
+ fn is_empty ( & self ) -> bool {
943
+ self . bindings . is_empty ( ) && self . ascriptions . is_empty ( )
944
+ }
945
+ }
946
+
941
947
/// A pattern in a form suitable for generating code.
942
948
#[ derive( Debug , Clone ) ]
943
949
struct FlatPat < ' pat , ' tcx > {
@@ -970,7 +976,7 @@ impl<'tcx, 'pat> FlatPat<'pat, 'tcx> {
970
976
971
977
#[ derive( Debug ) ]
972
978
struct Candidate < ' pat , ' tcx > {
973
- /// For the candidate to match, &ll of these must be satisfied...
979
+ /// For the candidate to match, all of these must be satisfied...
974
980
// Invariant: all the `MatchPair`s are recursively simplified.
975
981
// Invariant: or-patterns must be sorted at the end.
976
982
match_pairs : Vec < MatchPair < ' pat , ' tcx > > ,
@@ -1518,9 +1524,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
1518
1524
self . merge_trivial_subcandidates ( subcandidate, source_info) ;
1519
1525
1520
1526
// FIXME(or_patterns; matthewjasper) Try to be more aggressive here.
1521
- can_merge &= subcandidate. subcandidates . is_empty ( )
1522
- && subcandidate. extra_data . bindings . is_empty ( )
1523
- && subcandidate. extra_data . ascriptions . is_empty ( ) ;
1527
+ can_merge &=
1528
+ subcandidate. subcandidates . is_empty ( ) && subcandidate. extra_data . is_empty ( ) ;
1524
1529
}
1525
1530
1526
1531
if can_merge {
0 commit comments