Skip to content

Commit ebe71fd

Browse files
committed
change binding name of for loop lowering to appease clippy
With the latest change to for loop lowering, a `_next` binding was introduced. Unfortunately, this disturbs clippy's `used_underscore_binding` lint. This commit just renames the binding to `__next` so clippy will be happy. It should have no other effect.
1 parent bd32b1b commit ebe71fd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/librustc/hir/lowering.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -2170,12 +2170,12 @@ impl<'a> LoweringContext<'a> {
21702170
// let result = match ::std::iter::IntoIterator::into_iter(<head>) {
21712171
// mut iter => {
21722172
// [opt_ident]: loop {
2173-
// let mut _next;
2173+
// let mut __next;
21742174
// match ::std::iter::Iterator::next(&mut iter) {
2175-
// ::std::option::Option::Some(val) => _next = val,
2175+
// ::std::option::Option::Some(val) => __next = val,
21762176
// ::std::option::Option::None => break
21772177
// };
2178-
// let <pat> = _next;
2178+
// let <pat> = __next;
21792179
// StmtExpr(<body>);
21802180
// }
21812181
// }
@@ -2188,7 +2188,7 @@ impl<'a> LoweringContext<'a> {
21882188

21892189
let iter = self.str_to_ident("iter");
21902190

2191-
let next_ident = self.str_to_ident("_next");
2191+
let next_ident = self.str_to_ident("__next");
21922192
let next_pat = self.pat_ident_binding_mode(e.span,
21932193
next_ident,
21942194
hir::BindByValue(hir::MutMutable));
@@ -2237,13 +2237,13 @@ impl<'a> LoweringContext<'a> {
22372237

22382238
let next_expr = P(self.expr_ident(e.span, next_ident, next_pat.id));
22392239

2240-
// `let mut _next`
2240+
// `let mut __next`
22412241
let next_let = self.stmt_let_pat(e.span,
22422242
None,
22432243
next_pat,
22442244
hir::LocalSource::ForLoopDesugar);
22452245

2246-
// `let <pat> = _next`
2246+
// `let <pat> = __next`
22472247
let pat = self.lower_pat(pat);
22482248
let pat_let = self.stmt_let_pat(e.span,
22492249
Some(next_expr),

0 commit comments

Comments
 (0)