@@ -44,10 +44,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
4444 candidate : & mut Candidate < ' pat , ' tcx > ,
4545 ) -> bool {
4646 // repeatedly simplify match pairs until fixed point is reached
47- debug ! ( "simplify_candidate(candidate={:?})" , candidate ) ;
47+ debug ! ( ?candidate , "simplify_candidate" ) ;
4848
49- // exisiting_bindings and new_bindings exists to keep the semantics in order
50- // reversing the binding order for bindings after `@` change binding order in places
49+ // existing_bindings and new_bindings exists to keep the semantics in order.
50+ // Reversing the binding order for bindings after `@` changes the binding order in places
5151 // it shouldn't be changed, for example `let (Some(a), Some(b)) = (x, y)`
5252 //
5353 // To avoid this, the binding occurs in the following manner:
@@ -64,16 +64,16 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
6464 // binding in iter 2: [6, 7]
6565 //
6666 // final binding: [1, 2, 3, 6, 7, 4, 5]
67- let mut exisiting_bindings = mem:: take ( & mut candidate. bindings ) ;
67+ let mut existing_bindings = mem:: take ( & mut candidate. bindings ) ;
6868 let mut new_bindings = Vec :: new ( ) ;
6969 loop {
7070 let match_pairs = mem:: take ( & mut candidate. match_pairs ) ;
7171
7272 if let [ MatchPair { pattern : Pat { kind : box PatKind :: Or { pats } , .. } , place } ] =
7373 * match_pairs
7474 {
75- exisiting_bindings . extend_from_slice ( & new_bindings) ;
76- mem:: swap ( & mut candidate. bindings , & mut exisiting_bindings ) ;
75+ existing_bindings . extend_from_slice ( & new_bindings) ;
76+ mem:: swap ( & mut candidate. bindings , & mut existing_bindings ) ;
7777 candidate. subcandidates = self . create_or_subcandidates ( candidate, place, pats) ;
7878 return true ;
7979 }
@@ -89,7 +89,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
8989 }
9090 }
9191 }
92- // issue #69971: the binding order should be right to left if there are more
92+ // Avoid issue #69971: the binding order should be right to left if there are more
9393 // bindings after `@` to please the borrow checker
9494 // Ex
9595 // struct NonCopyStruct {
@@ -107,15 +107,15 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
107107 candidate. bindings . clear ( ) ;
108108
109109 if !changed {
110- exisiting_bindings . extend_from_slice ( & new_bindings) ;
111- mem:: swap ( & mut candidate. bindings , & mut exisiting_bindings ) ;
110+ existing_bindings . extend_from_slice ( & new_bindings) ;
111+ mem:: swap ( & mut candidate. bindings , & mut existing_bindings ) ;
112112 // Move or-patterns to the end, because they can result in us
113113 // creating additional candidates, so we want to test them as
114114 // late as possible.
115115 candidate
116116 . match_pairs
117117 . sort_by_key ( |pair| matches ! ( * pair. pattern. kind, PatKind :: Or { .. } ) ) ;
118- debug ! ( "simplify_candidate: simplifed {:?}" , candidate ) ;
118+ debug ! ( simplified = ?candidate , "simplify_candidate" ) ;
119119 return false ; // if we were not able to simplify any, done.
120120 }
121121 }
0 commit comments