@@ -44,10 +44,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
44
44
candidate : & mut Candidate < ' pat , ' tcx > ,
45
45
) -> bool {
46
46
// repeatedly simplify match pairs until fixed point is reached
47
- debug ! ( "simplify_candidate(candidate={:?})" , candidate ) ;
47
+ debug ! ( ?candidate , "simplify_candidate" ) ;
48
48
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
51
51
// it shouldn't be changed, for example `let (Some(a), Some(b)) = (x, y)`
52
52
//
53
53
// To avoid this, the binding occurs in the following manner:
@@ -64,16 +64,16 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
64
64
// binding in iter 2: [6, 7]
65
65
//
66
66
// 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 ) ;
68
68
let mut new_bindings = Vec :: new ( ) ;
69
69
loop {
70
70
let match_pairs = mem:: take ( & mut candidate. match_pairs ) ;
71
71
72
72
if let [ MatchPair { pattern : Pat { kind : box PatKind :: Or { pats } , .. } , place } ] =
73
73
* match_pairs
74
74
{
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 ) ;
77
77
candidate. subcandidates = self . create_or_subcandidates ( candidate, place, pats) ;
78
78
return true ;
79
79
}
@@ -89,7 +89,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
89
89
}
90
90
}
91
91
}
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
93
93
// bindings after `@` to please the borrow checker
94
94
// Ex
95
95
// struct NonCopyStruct {
@@ -107,15 +107,15 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
107
107
candidate. bindings . clear ( ) ;
108
108
109
109
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 ) ;
112
112
// Move or-patterns to the end, because they can result in us
113
113
// creating additional candidates, so we want to test them as
114
114
// late as possible.
115
115
candidate
116
116
. match_pairs
117
117
. sort_by_key ( |pair| matches ! ( * pair. pattern. kind, PatKind :: Or { .. } ) ) ;
118
- debug ! ( "simplify_candidate: simplifed {:?}" , candidate ) ;
118
+ debug ! ( simplified = ?candidate , "simplify_candidate" ) ;
119
119
return false ; // if we were not able to simplify any, done.
120
120
}
121
121
}
0 commit comments