]> git.lizzy.rs Git - rust.git/commitdiff
Rustup to rustc 1.16.0-nightly (468227129 2017-01-03): Dogfood fixes
authorManish Goregaokar <manishsmail@gmail.com>
Wed, 4 Jan 2017 23:48:34 +0000 (15:48 -0800)
committerManish Goregaokar <manishsmail@gmail.com>
Wed, 4 Jan 2017 23:50:57 +0000 (15:50 -0800)
clippy_lints/src/block_in_if_condition.rs
clippy_lints/src/eta_reduction.rs
clippy_lints/src/functions.rs
clippy_lints/src/lifetimes.rs
clippy_lints/src/shadow.rs
clippy_lints/src/types.rs

index efea48e64040c374823b99844baad723e9aef8ad..6a02e69a8818d01d5fad7bf96d5e7012105b62d0 100644 (file)
@@ -58,9 +58,9 @@ impl<'a, 'tcx: 'a> Visitor<'tcx> for ExVisitor<'a, 'tcx> {
     fn visit_expr(&mut self, expr: &'tcx Expr) {
         if let ExprClosure(_, _, eid, _) = expr.node {
             let body = self.cx.tcx.map.body(eid);
-            let expr = &body.value;
-            if matches!(expr.node, ExprBlock(_)) {
-                self.found_block = Some(&expr);
+            let ex = &body.value;
+            if matches!(ex.node, ExprBlock(_)) {
+                self.found_block = Some(ex);
                 return;
             }
         }
index c00ab3d0e637eb61c6d5f5c8fc92c31ba76d8b0e..19289803299493d6ce5e99e42ad0f15429248594 100644 (file)
@@ -50,14 +50,14 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
 fn check_closure(cx: &LateContext, expr: &Expr) {
     if let ExprClosure(_, ref decl, eid, _) = expr.node {
         let body = cx.tcx.map.body(eid);
-        let ref ex = body.value;
+        let ex = &body.value;
         if let ExprCall(ref caller, ref args) = ex.node {
             if args.len() != decl.inputs.len() {
                 // Not the same number of arguments, there
                 // is no way the closure is the same as the function
                 return;
             }
-            if is_adjusted(cx, &ex) || args.iter().any(|arg| is_adjusted(cx, arg)) {
+            if is_adjusted(cx, ex) || args.iter().any(|arg| is_adjusted(cx, arg)) {
                 // Are the expression or the arguments type-adjusted? Then we need the closure
                 return;
             }
index 24e4337399659b8c71a068bc736e700a37e9af1e..36d774b4f9f3c8ec20e052d7f7cffe27337c7d3f 100644 (file)
@@ -102,7 +102,7 @@ fn check_fn(
             }
         }
 
-        self.check_raw_ptr(cx, unsafety, decl, &body, nodeid);
+        self.check_raw_ptr(cx, unsafety, decl, body, nodeid);
     }
 
     fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::TraitItem) {
@@ -114,7 +114,7 @@ fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Trai
 
             if let hir::TraitMethod::Provided(eid) = *eid {
                 let body = cx.tcx.map.body(eid);
-                self.check_raw_ptr(cx, sig.unsafety, &sig.decl, &body, item.id);
+                self.check_raw_ptr(cx, sig.unsafety, &sig.decl, body, item.id);
             }
         }
     }
@@ -141,9 +141,9 @@ fn check_raw_ptr(
     ) {
         let expr = &body.value;
         if unsafety == hir::Unsafety::Normal && cx.access_levels.is_exported(nodeid) {
-            let raw_ptrs = iter_input_pats(&decl, body).zip(decl.inputs.iter())
-                                                            .filter_map(|(arg, ty)| raw_ptr_arg(arg, ty))
-                                                            .collect::<HashSet<_>>();
+            let raw_ptrs = iter_input_pats(decl, body).zip(decl.inputs.iter())
+                                                      .filter_map(|(arg, ty)| raw_ptr_arg(arg, ty))
+                                                      .collect::<HashSet<_>>();
 
             if !raw_ptrs.is_empty() {
                 let mut v = DerefVisitor {
index 2c3b06a98c4e7b38cb724be107de220a53705294..3006e5fc9b0d191c91f144bfeddae62f8b070ba0 100644 (file)
@@ -137,7 +137,7 @@ fn could_use_elision<'a, 'tcx: 'a, T: Iterator<Item = &'tcx Lifetime>>(
 
     // extract lifetimes in input argument types
     for arg in &func.inputs {
-        input_visitor.visit_ty(&arg);
+        input_visitor.visit_ty(arg);
     }
     // extract lifetimes in output type
     if let Return(ref ty) = func.output {
index e9208a13cf4172a6eb1f7b40cee66d9db5c2e734..a16fe7ae009119acf847587112d696c348fde8a9 100644 (file)
@@ -92,7 +92,7 @@ fn check_fn(
         if in_external_macro(cx, body.value.span) {
             return;
         }
-        check_fn(cx, decl, &body);
+        check_fn(cx, decl, body);
     }
 }
 
index 423071c457af4f3f307ee4edddd02d0e1fef5ee1..ae320db63bcd308c5ffd4abcac905b4798a2c3dc 100644 (file)
@@ -97,7 +97,7 @@ fn check_trait_item(&mut self, cx: &LateContext, item: &TraitItem) {
 
 fn check_fn_decl(cx: &LateContext, decl: &FnDecl) {
     for input in &decl.inputs {
-        check_ty(cx, &input);
+        check_ty(cx, input);
     }
 
     if let FunctionRetTy::Return(ref ty) = decl.output {
@@ -651,7 +651,7 @@ fn check_local(&mut self, cx: &LateContext<'a, 'tcx>, local: &'tcx Local) {
 impl<'a, 'tcx> TypeComplexityPass {
     fn check_fndecl(&self, cx: &LateContext<'a, 'tcx>, decl: &'tcx FnDecl) {
         for arg in &decl.inputs {
-            self.check_type(cx, &arg);
+            self.check_type(cx, arg);
         }
         if let Return(ref ty) = decl.output {
             self.check_type(cx, ty);