about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndre Bogus <bogusandre@gmail.com>2017-06-23 18:23:23 +0200
committerAndre Bogus <bogusandre@gmail.com>2017-06-23 18:23:23 +0200
commitebe71fdd53b47b2f1e684454e71e42062dbdf6a4 (patch)
tree823f3c81d72aec7a069c071f238a50b670fcfa2c
parentbd32b1ba0d2d51a7e8505c1d3e37d17d3ba12843 (diff)
downloadrust-ebe71fdd53b47b2f1e684454e71e42062dbdf6a4.tar.gz
rust-ebe71fdd53b47b2f1e684454e71e42062dbdf6a4.zip
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.
-rw-r--r--src/librustc/hir/lowering.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs
index 62bedcdfcbe..873d39ec9e9 100644
--- a/src/librustc/hir/lowering.rs
+++ b/src/librustc/hir/lowering.rs
@@ -2170,12 +2170,12 @@ impl<'a> LoweringContext<'a> {
                 //     let result = match ::std::iter::IntoIterator::into_iter(<head>) {
                 //       mut iter => {
                 //         [opt_ident]: loop {
-                //           let mut _next;
+                //           let mut __next;
                 //           match ::std::iter::Iterator::next(&mut iter) {
-                //             ::std::option::Option::Some(val) => _next = val,
+                //             ::std::option::Option::Some(val) => __next = val,
                 //             ::std::option::Option::None => break
                 //           };
-                //           let <pat> = _next;
+                //           let <pat> = __next;
                 //           StmtExpr(<body>);
                 //         }
                 //       }
@@ -2188,7 +2188,7 @@ impl<'a> LoweringContext<'a> {
 
                 let iter = self.str_to_ident("iter");
 
-                let next_ident = self.str_to_ident("_next");
+                let next_ident = self.str_to_ident("__next");
                 let next_pat = self.pat_ident_binding_mode(e.span,
                                                            next_ident,
                                                            hir::BindByValue(hir::MutMutable));
@@ -2237,13 +2237,13 @@ impl<'a> LoweringContext<'a> {
 
                 let next_expr = P(self.expr_ident(e.span, next_ident, next_pat.id));
 
-                // `let mut _next`
+                // `let mut __next`
                 let next_let = self.stmt_let_pat(e.span,
                     None,
                     next_pat,
                     hir::LocalSource::ForLoopDesugar);
 
-                // `let <pat> = _next`
+                // `let <pat> = __next`
                 let pat = self.lower_pat(pat);
                 let pat_let = self.stmt_let_pat(e.span,
                     Some(next_expr),