]> git.lizzy.rs Git - rust.git/commitdiff
update to the rust-PR that unblocks clippy
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Wed, 7 Dec 2016 12:13:40 +0000 (13:13 +0100)
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Wed, 7 Dec 2016 12:13:40 +0000 (13:13 +0100)
66 files changed:
clippy_lints/src/approx_const.rs
clippy_lints/src/arithmetic.rs
clippy_lints/src/array_indexing.rs
clippy_lints/src/assign_ops.rs
clippy_lints/src/attrs.rs
clippy_lints/src/bit_mask.rs
clippy_lints/src/blacklisted_name.rs
clippy_lints/src/block_in_if_condition.rs
clippy_lints/src/booleans.rs
clippy_lints/src/copies.rs
clippy_lints/src/cyclomatic_complexity.rs
clippy_lints/src/derive.rs
clippy_lints/src/drop_ref.rs
clippy_lints/src/entry.rs
clippy_lints/src/enum_clike.rs
clippy_lints/src/enum_glob_use.rs
clippy_lints/src/eq_op.rs
clippy_lints/src/escape.rs
clippy_lints/src/eta_reduction.rs
clippy_lints/src/eval_order_dependence.rs
clippy_lints/src/format.rs
clippy_lints/src/functions.rs
clippy_lints/src/identity_op.rs
clippy_lints/src/if_let_redundant_pattern_matching.rs
clippy_lints/src/len_zero.rs
clippy_lints/src/let_if_seq.rs
clippy_lints/src/lifetimes.rs
clippy_lints/src/loops.rs
clippy_lints/src/map_clone.rs
clippy_lints/src/matches.rs
clippy_lints/src/mem_forget.rs
clippy_lints/src/methods.rs
clippy_lints/src/minmax.rs
clippy_lints/src/misc.rs
clippy_lints/src/missing_doc.rs
clippy_lints/src/mut_mut.rs
clippy_lints/src/mut_reference.rs
clippy_lints/src/mutex_atomic.rs
clippy_lints/src/needless_bool.rs
clippy_lints/src/needless_borrow.rs
clippy_lints/src/needless_update.rs
clippy_lints/src/neg_multiply.rs
clippy_lints/src/new_without_default.rs
clippy_lints/src/no_effect.rs
clippy_lints/src/ok_if_let.rs
clippy_lints/src/open_options.rs
clippy_lints/src/overflow_check_conditional.rs
clippy_lints/src/panic.rs
clippy_lints/src/partialeq_ne_impl.rs
clippy_lints/src/print.rs
clippy_lints/src/ptr.rs
clippy_lints/src/ranges.rs
clippy_lints/src/regex.rs
clippy_lints/src/serde.rs
clippy_lints/src/shadow.rs
clippy_lints/src/strings.rs
clippy_lints/src/swap.rs
clippy_lints/src/temporary_assignment.rs
clippy_lints/src/transmute.rs
clippy_lints/src/types.rs
clippy_lints/src/unicode.rs
clippy_lints/src/unused_label.rs
clippy_lints/src/utils/inspector.rs
clippy_lints/src/utils/internal_lints.rs
clippy_lints/src/vec.rs
clippy_lints/src/zero_div_zero.rs

index 9a6678f176a125449b75c2b37326369abd0979ea..3ccb5f6ef2a00ff110d059739434f838e394615c 100644 (file)
@@ -59,8 +59,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
         if let ExprLit(ref lit) = e.node {
             check_lit(cx, lit, e);
         }
index 0ae64e0e7872c751bf3293d08cd65960fdae1be3..5020295e20c96f85c52172d1759303f95651c106 100644 (file)
@@ -47,8 +47,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Arithmetic {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Arithmetic {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
         if self.span.is_some() {
             return;
         }
@@ -82,7 +82,7 @@ fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx h
         }
     }
 
-    fn check_expr_post<'a, 'tcx: 'a>(&mut self, _: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
+    fn check_expr_post(&mut self, _: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
         if Some(expr.span) == self.span {
             self.span = None;
         }
index 1f68c32cd24ff00e039d2c38fb6d527e033c4f7f..399f93d08c7cd419641f715efa4e534db03fe83b 100644 (file)
@@ -55,8 +55,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for ArrayIndexing {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx hir::Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ArrayIndexing {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx hir::Expr) {
         if let hir::ExprIndex(ref array, ref index) = e.node {
             // Array with known size can be checked statically
             let ty = cx.tcx.tables().expr_ty(array);
index 84b61b1cba42b85720aecdb7a9db2618ed59c3ed..ef6898cef885611182d3a68c03f52b624593271f 100644 (file)
@@ -66,8 +66,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for AssignOps {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
         match expr.node {
             hir::ExprAssignOp(op, ref lhs, ref rhs) => {
                 span_lint_and_then(cx, ASSIGN_OPS, expr.span, "assign operation detected", |db| {
index 5ddbeb5704682e97859ba00170b69d7d6f4ababe..a37b08363957494e1ab72e3b67303b1b88a57163 100644 (file)
@@ -81,8 +81,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for AttrPass {
-    fn check_attribute<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, attr: &'tcx Attribute) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
+    fn check_attribute(&mut self, cx: &LateContext<'a, 'tcx>, attr: &'tcx Attribute) {
         if let MetaItemKind::List(ref items) = attr.value.node {
             if items.is_empty() || attr.name() != "deprecated" {
                 return;
@@ -99,7 +99,7 @@ fn check_attribute<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, attr: &'
         }
     }
 
-    fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
         if is_relevant_item(cx, item) {
             check_attrs(cx, item.span, &item.name, &item.attrs)
         }
@@ -138,13 +138,13 @@ fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx I
         }
     }
 
-    fn check_impl_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
+    fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
         if is_relevant_impl(cx, item) {
             check_attrs(cx, item.span, &item.name, &item.attrs)
         }
     }
 
-    fn check_trait_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
         if is_relevant_trait(cx, item) {
             check_attrs(cx, item.span, &item.name, &item.attrs)
         }
index fb305f8907d54ef86db80e469b2084a173600f56..0e569bc76f7b5cf22f07cf42dd3382e593560835 100644 (file)
@@ -79,8 +79,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for BitMask {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BitMask {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
         if let ExprBinary(ref cmp, ref left, ref right) = e.node {
             if cmp.node.is_comparison() {
                 if let Some(cmp_opt) = fetch_int_literal(cx, right) {
index 542bf0a4f2854c0c3a96fa2de7b2465a1bd007bd..2f9a50fe3dac84d16e833278e9691de53982b0ca 100644 (file)
@@ -37,8 +37,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for BlackListedName {
-    fn check_pat<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, pat: &'tcx Pat) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BlackListedName {
+    fn check_pat(&mut self, cx: &LateContext<'a, 'tcx>, pat: &'tcx Pat) {
         if let PatKind::Binding(_, _, ref ident, _) = pat.node {
             if self.blacklist.iter().any(|s| s == &*ident.node.as_str()) {
                 span_lint(cx,
index 1ac96bf6bcafb533c632eabdda004e40a05a6749..de004afa1a6c8eabd74442f564b62b7cb24f20f2 100644 (file)
@@ -74,8 +74,8 @@ fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
 const COMPLEX_BLOCK_MESSAGE: &'static str = "in an 'if' condition, avoid complex blocks or closures with blocks; \
                                              instead, move the block or closure higher and bind it with a 'let'";
 
-impl LateLintPass for BlockInIfCondition {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BlockInIfCondition {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if let ExprIf(ref check, ref then, _) = expr.node {
             if let ExprBlock(ref block) = check.node {
                 if block.rules == DefaultBlock {
index 64c575046a21bda26517824f1b4999138bcc09a7..bd5657483112e5a89005a057cf1d3da322121ed6 100644 (file)
@@ -53,8 +53,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for NonminimalBool {
-    fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonminimalBool {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
         NonminimalBoolVisitor { cx: cx }.visit_item(item)
     }
 }
index 1931b5d1e3f6fff964e2aea604767a45dd9d01db..9fa38ad02b3eab4fa31c98df8eeba5fafff1f985 100644 (file)
@@ -109,8 +109,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for CopyAndPaste {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CopyAndPaste {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if !in_macro(cx, expr.span) {
             // skip ifs directly in else, it will be checked in the parent if
             if let Some(&Expr { node: ExprIf(_, _, Some(ref else_expr)), .. }) = get_parent_expr(cx, expr) {
index 67066d32cc3e9e1d3da4296358703538e1dec0f8..164633b7c6445281cbaf7b16d77ea1c980e05e86 100644 (file)
@@ -90,8 +90,8 @@ fn check<'a, 'tcx: 'a>(&mut self, cx: &'a LateContext<'a, 'tcx>, expr: &'tcx Exp
     }
 }
 
-impl LateLintPass for CyclomaticComplexity {
-    fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CyclomaticComplexity {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
         if let ItemFn(_, _, _, _, _, eid) = item.node {
             if !attr::contains_name(&item.attrs, "test") {
                 self.check(cx, cx.tcx.map.expr(eid), item.span);
@@ -99,22 +99,22 @@ fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx I
         }
     }
 
-    fn check_impl_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
+    fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
         if let ImplItemKind::Method(_, eid) = item.node {
             self.check(cx, cx.tcx.map.expr(eid), item.span);
         }
     }
 
-    fn check_trait_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
         if let MethodTraitItem(_, Some(eid)) = item.node {
             self.check(cx, cx.tcx.map.expr(eid), item.span);
         }
     }
 
-    fn enter_lint_attrs<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, attrs: &'tcx [Attribute]) {
+    fn enter_lint_attrs(&mut self, cx: &LateContext<'a, 'tcx>, attrs: &'tcx [Attribute]) {
         self.limit.push_attrs(cx.sess(), attrs, "cyclomatic_complexity");
     }
-    fn exit_lint_attrs<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, attrs: &'tcx [Attribute]) {
+    fn exit_lint_attrs(&mut self, cx: &LateContext<'a, 'tcx>, attrs: &'tcx [Attribute]) {
         self.limit.pop_attrs(cx.sess(), attrs, "cyclomatic_complexity");
     }
 }
index 4e9f7d9c6645360ebd8fe9c001fc0e39ade14087..449227c9767972600bf4d26f1063d67e8503e64d 100644 (file)
@@ -70,8 +70,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Derive {
-    fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Derive {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
         if let ItemImpl(_, _, _, Some(ref trait_ref), _, _) = item.node {
             let ty = cx.tcx.item_type(cx.tcx.map.local_def_id(item.id));
             let is_automatically_derived = is_automatically_derived(&*item.attrs);
@@ -86,7 +86,7 @@ fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx I
 }
 
 /// Implementation of the `DERIVE_HASH_XOR_EQ` lint.
-fn check_hash_peq<'a, 'tcx: 'a>(cx: &LateContext<'a, 'tcx>, span: Span, trait_ref: &TraitRef, ty: ty::Ty<'tcx>,
+fn check_hash_peq<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, span: Span, trait_ref: &TraitRef, ty: ty::Ty<'tcx>,
                                 hash_is_automatically_derived: bool) {
     if_let_chain! {[
         match_path_old(&trait_ref.path, &paths::HASH),
index c16d879ec2f546d3463feba54e88a2e1a5f08532..106e43e1b6f570a29f0427fb127e5ad24589d2f4 100644 (file)
@@ -35,8 +35,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if let ExprCall(ref path, ref args) = expr.node {
             if let ExprPath(ref qpath) = path.node {
                 let def_id = cx.tcx.tables().qpath_def(qpath, path.id).def_id();
index 133d2dc68f92e74d521746a0dc9cd2d98f891e2c..00a41c2e986cf60ffba1323f67c4fab7e75d5e40 100644 (file)
@@ -39,8 +39,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for HashMapLint {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for HashMapLint {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if let ExprIf(ref check, ref then_block, ref else_block) = expr.node {
             if let ExprUnary(UnOp::UnNot, ref check) = check.node {
                 if let Some((ty, map, key)) = check_cond(cx, check) {
index 28fd9833e25c6094e2f92a203843eb2a479ac7f8..f4181da3c2b704b42ceecc201c00cafc640bf76e 100644 (file)
@@ -36,9 +36,9 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for UnportableVariant {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnportableVariant {
     #[allow(cast_possible_truncation, cast_sign_loss)]
-    fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
         if let ItemEnum(ref def, _) = item.node {
             for var in &def.variants {
                 let variant = &var.node;
index 1db8607bd25720289e408bce1f54e75075c5659f..4dafcf365a6c6b4ffe69b0bec724531fad9913cf 100644 (file)
@@ -32,8 +32,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for EnumGlobUse {
-    fn check_mod<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, m: &'tcx Mod, _: Span, _: NodeId) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EnumGlobUse {
+    fn check_mod(&mut self, cx: &LateContext<'a, 'tcx>, m: &'tcx Mod, _: Span, _: NodeId) {
         // only check top level `use` statements
         for item in &m.item_ids {
             self.lint_item(cx, cx.krate.item(item.id));
index 8cfeabba9fcb2ad136932e0796093da425d8581d..c43dfe6e27ca260a49f69e6fd331ce4f74af8c14 100644 (file)
@@ -32,8 +32,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for EqOp {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
         if let ExprBinary(ref op, ref left, ref right) = e.node {
             if is_valid_operator(op) && SpanlessEq::new(cx).ignore_fn().eq_expr(left, right) {
                 span_lint(cx,
index df01e0481a80086bfe3e84cc2a8277d5452af740..0ca1f143b16471be926fe2a4b493bf710a7c86d0 100644 (file)
@@ -60,8 +60,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_fn<'a, 'tcx: 'a>(
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_fn(
         &mut self,
         cx: &LateContext<'a, 'tcx>,
         _: visit::FnKind<'tcx>,
index c8d468f7fa90eac015bdefdbfb313805be5a1294..56308ed390d8b6ce9c1d89f28c76fa67d34f1323 100644 (file)
@@ -33,8 +33,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for EtaPass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EtaPass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         match expr.node {
             ExprCall(_, ref args) |
             ExprMethodCall(_, _, ref args) => {
index 3a991b0f28b29b54389bb5c7e39e42147e6f7100..9e9a900fe7ab92f2ce870db685f3e5e2085c09ad 100644 (file)
@@ -56,8 +56,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for EvalOrderDependence {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EvalOrderDependence {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         // Find a write to a local variable.
         match expr.node {
             ExprAssign(ref lhs, _) | ExprAssignOp(_, ref lhs, _) => {
@@ -79,7 +79,7 @@ fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx E
             _ => {}
         }
     }
-    fn check_stmt<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, stmt: &'tcx Stmt) {
+    fn check_stmt(&mut self, cx: &LateContext<'a, 'tcx>, stmt: &'tcx Stmt) {
         match stmt.node {
             StmtExpr(ref e, _) | StmtSemi(ref e, _) => DivergenceVisitor { cx: cx }.maybe_walk_expr(e),
             StmtDecl(ref d, _) => {
@@ -214,7 +214,7 @@ enum StopEarly {
     Stop,
 }
 
-fn check_expr<'a, 'tcx: 'a>(vis: & mut ReadVisitor<'a, 'tcx>, expr: &'tcx Expr) -> StopEarly {
+fn check_expr<'a, 'tcx>(vis: & mut ReadVisitor<'a, 'tcx>, expr: &'tcx Expr) -> StopEarly {
     if expr.id == vis.last_expr.id {
         return StopEarly::KeepGoing;
     }
@@ -263,7 +263,7 @@ fn check_expr<'a, 'tcx: 'a>(vis: & mut ReadVisitor<'a, 'tcx>, expr: &'tcx Expr)
     StopEarly::KeepGoing
 }
 
-fn check_stmt<'a, 'tcx: 'a>(vis: &mut ReadVisitor<'a, 'tcx>, stmt: &'tcx Stmt) -> StopEarly {
+fn check_stmt<'a, 'tcx>(vis: &mut ReadVisitor<'a, 'tcx>, stmt: &'tcx Stmt) -> StopEarly {
     match stmt.node {
         StmtExpr(ref expr, _) |
         StmtSemi(ref expr, _) => check_expr(vis, expr),
index 236888fe191e9ef3fca71aaf8a4f9d4a184ff1de..0cf4762364ba27fe7de31039ef6631fa71a5dc87 100644 (file)
@@ -38,8 +38,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if let Some(span) = is_expn_of(cx, expr.span, "format") {
             match expr.node {
                 // `format!("{}", foo)` expansion
index 0d9a668e8b621b8af330e93d705b31af385eeadd..52461d08ee8d721a3350ae0048eedecb6440a073 100644 (file)
@@ -68,8 +68,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Functions {
-    fn check_fn<'a, 'tcx: 'a>(
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
+    fn check_fn(
         &mut self,
         cx: &LateContext<'a, 'tcx>,
         kind: intravisit::FnKind<'tcx>,
@@ -105,7 +105,7 @@ fn check_fn<'a, 'tcx: 'a>(
         self.check_raw_ptr(cx, unsafety, decl, expr, nodeid);
     }
 
-    fn check_trait_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::TraitItem) {
         if let hir::MethodTraitItem(ref sig, eid) = item.node {
             // don't lint extern functions decls, it's not their fault
             if sig.abi == Abi::Rust {
@@ -120,7 +120,7 @@ fn check_trait_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &
     }
 }
 
-impl Functions {
+impl<'a, 'tcx> Functions {
     fn check_arg_number(&self, cx: &LateContext, decl: &hir::FnDecl, span: Span) {
         let args = decl.inputs.len() as u64;
         if args > self.threshold {
@@ -131,7 +131,7 @@ fn check_arg_number(&self, cx: &LateContext, decl: &hir::FnDecl, span: Span) {
         }
     }
 
-    fn check_raw_ptr<'a, 'tcx: 'a>(
+    fn check_raw_ptr(
         &self,
         cx: &LateContext<'a, 'tcx>,
         unsafety: hir::Unsafety,
index f360c59372bc5eba4e4a502d2ac2300901a03ea0..547aa23f0de8405bd78da2cd356b8f6420711da0 100644 (file)
@@ -31,8 +31,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for IdentityOp {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for IdentityOp {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
         if in_macro(cx, e.span) {
             return;
         }
index bc834886db96eada09b5f7c85f632005f4b62652..399b58956bd6334b49dddcc7f67cf4aa588d9de4 100644 (file)
@@ -42,8 +42,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
 
         if let ExprMatch(ref op, ref arms, MatchSource::IfLetDesugar{..}) = expr.node {
 
index 98db74cff3a21673a0bfe5aff05778f520119a31..fd58f86d42f66bcfae10c016f174c17da88abb9e 100644 (file)
@@ -59,8 +59,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for LenZero {
-    fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LenZero {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
         if in_macro(cx, item.span) {
             return;
         }
@@ -72,7 +72,7 @@ fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx I
         }
     }
 
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if in_macro(cx, expr.span) {
             return;
         }
index 1605505a6ae3dbb8346b3470703d0788737ba975..474a86cdb7884a8c5322aff42edc193e83c9a10e 100644 (file)
@@ -57,8 +57,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for LetIfSeq {
-    fn check_block<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, block: &'tcx hir::Block) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LetIfSeq {
+    fn check_block(&mut self, cx: &LateContext<'a, 'tcx>, block: &'tcx hir::Block) {
         let mut it = block.stmts.iter().peekable();
         while let Some(stmt) = it.next() {
             if_let_chain! {[
@@ -149,7 +149,7 @@ fn nested_visit_map<'this>(&'this mut self) -> hir::intravisit::NestedVisitorMap
     }
 }
 
-fn check_assign<'a, 'tcx: 'a>(
+fn check_assign<'a, 'tcx>(
     cx: &LateContext<'a, 'tcx>,
     decl: hir::def_id::DefId,
     block: &'tcx hir::Block,
index 22e7384675fb7919eca84134466f3084918a0c82..60132ad9161c4f6738cd363a7ee56555a3bb7353 100644 (file)
@@ -56,20 +56,20 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for LifetimePass {
-    fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LifetimePass {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
         if let ItemFn(ref decl, _, _, _, ref generics, _) = item.node {
             check_fn_inner(cx, decl, generics, item.span);
         }
     }
 
-    fn check_impl_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
+    fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
         if let ImplItemKind::Method(ref sig, _) = item.node {
             check_fn_inner(cx, &sig.decl, &sig.generics, item.span);
         }
     }
 
-    fn check_trait_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
         if let MethodTraitItem(ref sig, _) = item.node {
             check_fn_inner(cx, &sig.decl, &sig.generics, item.span);
         }
@@ -98,7 +98,7 @@ fn bound_lifetimes(bound: &TyParamBound) -> HirVec<&Lifetime> {
     }
 }
 
-fn check_fn_inner<'a, 'tcx: 'a>(
+fn check_fn_inner<'a, 'tcx>(
     cx: &LateContext<'a, 'tcx>,
     decl: &'tcx FnDecl,
     generics: &'tcx Generics,
index 233c6289009686db7a1de9412379af100a81f55a..77f2df03a6a405fce66d06fea8592d1d2eb8506b 100644 (file)
@@ -307,8 +307,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if let Some((pat, arg, body)) = higher::for_loop(expr) {
             check_for_loop(cx, pat, arg, body, expr);
         }
@@ -391,7 +391,7 @@ fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx E
         }
     }
 
-    fn check_stmt<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, stmt: &'tcx Stmt) {
+    fn check_stmt(&mut self, cx: &LateContext<'a, 'tcx>, stmt: &'tcx Stmt) {
         if let StmtSemi(ref expr, _) = stmt.node {
             if let ExprMethodCall(ref method, _, ref args) = expr.node {
                 if args.len() == 1 && &*method.node.as_str() == "collect" &&
@@ -407,7 +407,7 @@ fn check_stmt<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, stmt: &'tcx S
     }
 }
 
-fn check_for_loop<'a, 'tcx: 'a>(
+fn check_for_loop<'a, 'tcx>(
     cx: &LateContext<'a, 'tcx>,
     pat: &'tcx Pat,
     arg: &'tcx Expr,
@@ -423,7 +423,7 @@ fn check_for_loop<'a, 'tcx: 'a>(
 
 /// Check for looping over a range and then indexing a sequence with it.
 /// The iteratee must be a range literal.
-fn check_for_loop_range<'a, 'tcx: 'a>(
+fn check_for_loop_range<'a, 'tcx>(
     cx: &LateContext<'a, 'tcx>,
     pat: &'tcx Pat,
     arg: &'tcx Expr,
@@ -658,7 +658,7 @@ fn check_arg_type(cx: &LateContext, pat: &Pat, arg: &Expr) {
     }
 }
 
-fn check_for_loop_explicit_counter<'a, 'tcx: 'a>(
+fn check_for_loop_explicit_counter<'a, 'tcx>(
     cx: &LateContext<'a, 'tcx>,
     arg: &'tcx Expr,
     body: &'tcx Expr,
@@ -708,7 +708,7 @@ fn check_for_loop_explicit_counter<'a, 'tcx: 'a>(
 }
 
 /// Check for the `FOR_KV_MAP` lint.
-fn check_for_loop_over_map_kv<'a, 'tcx: 'a>(
+fn check_for_loop_over_map_kv<'a, 'tcx>(
     cx: &LateContext<'a, 'tcx>,
     pat: &'tcx Pat,
     arg: &'tcx Expr,
index 416f9dcf93eb97b12dbea7eddab4775feaf5da0b..4539c3c8c1054cd64d86fbebc2c04d684cf14984 100644 (file)
@@ -24,8 +24,8 @@
 #[derive(Copy, Clone)]
 pub struct Pass;
 
-impl LateLintPass for Pass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         // call to .map()
         if let ExprMethodCall(name, _, ref args) = expr.node {
             if &*name.node.as_str() == "map" && args.len() == 2 {
index 0820a81373294aaac2811d075a457cdd81e2cedb..1d59afd9eace101015018c70da50fab46eccfce7 100644 (file)
@@ -129,8 +129,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for MatchPass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MatchPass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if in_external_macro(cx, expr.span) {
             return;
         }
index e3299958ae685420f02ce5f6eaec902b08691614..55654a7de43b772a1b809f7ef9af0fb7e6f66d04 100644 (file)
@@ -27,8 +27,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for MemForget {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MemForget {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
         if let ExprCall(ref path_expr, ref args) = e.node {
             if let ExprPath(ref qpath) = path_expr.node {
                 let def_id = cx.tcx.tables().qpath_def(qpath, path_expr.id).def_id();
index dd99f5a358ba76ec20da54549d7c0324a02e7ff1..cb8fd62961d86c552de5d5ac51625068baf342be 100644 (file)
@@ -549,11 +549,11 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
     #[allow(unused_attributes)]
     // ^ required because `cyclomatic_complexity` attribute shows up as unused
     #[cyclomatic_complexity = "30"]
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
         if in_macro(cx, expr.span) {
             return;
         }
@@ -629,7 +629,7 @@ fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx h
         }
     }
 
-    fn check_impl_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, implitem: &'tcx hir::ImplItem) {
+    fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, implitem: &'tcx hir::ImplItem) {
         if in_external_macro(cx, implitem.span) {
             return;
         }
index f1f353cb762c8f94312ad5512710fba16cce9774..ccfc01a0003089b9b7c55bae9d64c41d39c5f593 100644 (file)
@@ -33,8 +33,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for MinMaxPass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MinMaxPass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if let Some((outer_max, outer_c, oe)) = min_max(cx, expr) {
             if let Some((inner_max, inner_c, _)) = min_max(cx, oe) {
                 if outer_max == inner_max {
index 679bad666b9f96bd1cbe96cf1ad3b26ef0185e5c..0680f6b41a16257185a23ace4b2dac94e7cc5c17 100644 (file)
@@ -166,8 +166,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_fn<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, k: FnKind<'tcx>, decl: &'tcx FnDecl, _: &'tcx Expr, _: Span, _: NodeId) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_fn(&mut self, cx: &LateContext<'a, 'tcx>, k: FnKind<'tcx>, decl: &'tcx FnDecl, _: &'tcx Expr, _: Span, _: NodeId) {
         if let FnKind::Closure(_) = k {
             // Does not apply to closures
             return;
@@ -182,7 +182,7 @@ fn check_fn<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, k: FnKind<'tcx>
         }
     }
 
-    fn check_stmt<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, s: &'tcx Stmt) {
+    fn check_stmt(&mut self, cx: &LateContext<'a, 'tcx>, s: &'tcx Stmt) {
         if_let_chain! {[
             let StmtDecl(ref d, _) = s.node,
             let DeclLocal(ref l) = d.node,
@@ -216,7 +216,7 @@ fn check_stmt<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, s: &'tcx Stmt
         }}
     }
 
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if let ExprBinary(ref cmp, ref left, ref right) = expr.node {
             let op = cmp.node;
             if op.is_comparison() {
@@ -294,7 +294,7 @@ fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx E
         }
     }
 
-    fn check_pat<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, pat: &'tcx Pat) {
+    fn check_pat(&mut self, cx: &LateContext<'a, 'tcx>, pat: &'tcx Pat) {
         if let PatKind::Binding(_, _, ref ident, Some(ref right)) = pat.node {
             if right.node == PatKind::Wild {
                 span_lint(cx,
index e40638616b6ebff899b481c0a893cbc2616d6a8e..2f3bdeb053c8fe3406f72939fe5215efbd54e8a9 100644 (file)
@@ -94,8 +94,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for MissingDoc {
-    fn enter_lint_attrs<'a, 'tcx: 'a>(&mut self, _: &LateContext<'a, 'tcx>, attrs: &'tcx [ast::Attribute]) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
+    fn enter_lint_attrs(&mut self, _: &LateContext<'a, 'tcx>, attrs: &'tcx [ast::Attribute]) {
         let doc_hidden = self.doc_hidden() || attrs.iter().any(|attr| {
             attr.check_name("doc") && match attr.meta_item_list() {
                 None => false,
@@ -105,15 +105,15 @@ fn enter_lint_attrs<'a, 'tcx: 'a>(&mut self, _: &LateContext<'a, 'tcx>, attrs: &
         self.doc_hidden_stack.push(doc_hidden);
     }
 
-    fn exit_lint_attrs<'a, 'tcx: 'a>(&mut self, _: &LateContext<'a, 'tcx>, _: &'tcx [ast::Attribute]) {
+    fn exit_lint_attrs(&mut self, _: &LateContext<'a, 'tcx>, _: &'tcx [ast::Attribute]) {
         self.doc_hidden_stack.pop().expect("empty doc_hidden_stack");
     }
 
-    fn check_crate<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, krate: &'tcx hir::Crate) {
+    fn check_crate(&mut self, cx: &LateContext<'a, 'tcx>, krate: &'tcx hir::Crate) {
         self.check_missing_docs_attrs(cx, &krate.attrs, krate.span, "crate");
     }
 
-    fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
         let desc = match it.node {
             hir::ItemConst(..) => "a constant",
             hir::ItemEnum(..) => "an enum",
@@ -134,7 +134,7 @@ fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir
         self.check_missing_docs_attrs(cx, &it.attrs, it.span, desc);
     }
 
-    fn check_trait_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, trait_item: &'tcx hir::TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, trait_item: &'tcx hir::TraitItem) {
         let desc = match trait_item.node {
             hir::ConstTraitItem(..) => "an associated constant",
             hir::MethodTraitItem(..) => "a trait method",
@@ -144,7 +144,7 @@ fn check_trait_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, trait_i
         self.check_missing_docs_attrs(cx, &trait_item.attrs, trait_item.span, desc);
     }
 
-    fn check_impl_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx hir::ImplItem) {
+    fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx hir::ImplItem) {
         // If the method is an impl for a trait, don't doc.
         let def_id = cx.tcx.map.local_def_id(impl_item.id);
         match cx.tcx.associated_item(def_id).container {
@@ -164,13 +164,13 @@ fn check_impl_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, impl_ite
         self.check_missing_docs_attrs(cx, &impl_item.attrs, impl_item.span, desc);
     }
 
-    fn check_struct_field<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, sf: &'tcx hir::StructField) {
+    fn check_struct_field(&mut self, cx: &LateContext<'a, 'tcx>, sf: &'tcx hir::StructField) {
         if !sf.is_positional() {
             self.check_missing_docs_attrs(cx, &sf.attrs, sf.span, "a struct field");
         }
     }
 
-    fn check_variant<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, v: &'tcx hir::Variant, _: &hir::Generics) {
+    fn check_variant(&mut self, cx: &LateContext<'a, 'tcx>, v: &'tcx hir::Variant, _: &hir::Generics) {
         self.check_missing_docs_attrs(cx, &v.node.attrs, v.span, "a variant");
     }
 }
index 303c53186024ad7703a03bd24775c020234cbed2..40bb77871dbc641caaa23351c44474c078261507 100644 (file)
@@ -31,12 +31,12 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for MutMut {
-    fn check_block<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, block: &'tcx hir::Block) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MutMut {
+    fn check_block(&mut self, cx: &LateContext<'a, 'tcx>, block: &'tcx hir::Block) {
         intravisit::walk_block(&mut MutVisitor { cx: cx }, block);
     }
 
-    fn check_ty<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, ty: &'tcx hir::Ty) {
+    fn check_ty(&mut self, cx: &LateContext<'a, 'tcx>, ty: &'tcx hir::Ty) {
         use rustc::hir::intravisit::Visitor;
 
         MutVisitor { cx: cx }.visit_ty(ty);
index 08d39b7c43d602c4a4d85580ed17f26fdd37c251..c189ecba6de714ff21d0b1f8af6f350551b629fc 100644 (file)
@@ -32,8 +32,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for UnnecessaryMutPassed {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnnecessaryMutPassed {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
         let borrowed_table = cx.tcx.tables.borrow();
         match e.node {
             ExprCall(ref fn_expr, ref arguments) => {
index 71fcda814a3b3b69158339716d0c999b520449ca..8d927110b9d22494495c35ed84660e256a1e2c1b 100644 (file)
@@ -54,8 +54,8 @@ fn get_lints(&self) -> LintArray {
 
 pub struct MutexAtomic;
 
-impl LateLintPass for MutexAtomic {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MutexAtomic {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         let ty = cx.tcx.tables().expr_ty(expr);
         if let ty::TyAdt(_, subst) = ty.sty {
             if match_type(cx, ty, &paths::MUTEX) {
index bfa51f0ba703eb71d0c61bc95d65041835678838..3b08ebdbc8e04d03f252e6e17b1470afe4caa5ba 100644 (file)
@@ -56,8 +56,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for NeedlessBool {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessBool {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
         use self::Expression::*;
         if let ExprIf(ref pred, ref then_block, Some(ref else_expr)) = e.node {
             let reduce = |ret, not| {
@@ -116,8 +116,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for BoolComparison {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoolComparison {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
         use self::Expression::*;
         if let ExprBinary(Spanned { node: BiEq, .. }, ref left_side, ref right_side) = e.node {
             match (fetch_bool_expr(left_side), fetch_bool_expr(right_side)) {
index 0f03ff774d2b753b8402e4595888001c65d52f81..935e0da8c3edcd43c7e3ae595aa5b974d56945ca 100644 (file)
@@ -34,8 +34,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for NeedlessBorrow {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessBorrow {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
         if in_macro(cx, e.span) {
             return;
         }
@@ -53,7 +53,7 @@ fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr
             }
         }
     }
-    fn check_pat<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, pat: &'tcx Pat) {
+    fn check_pat(&mut self, cx: &LateContext<'a, 'tcx>, pat: &'tcx Pat) {
         if in_macro(cx, pat.span) {
             return;
         }
index 82cd502081f7c7e347261845005f668ec8074fb2..de6277aa0ee5c8cefc6daaa9b8b019dff197ca4c 100644 (file)
@@ -30,8 +30,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if let ExprStruct(_, ref fields, Some(ref base)) = expr.node {
             let ty = cx.tcx.tables().expr_ty(expr);
             if let TyAdt(def, _) = ty.sty {
index 6b0c8001ed2254886d6c0533494ccd63a960bf79..05a6a92c9e9da5a76e359fd72f6cebc66b931854 100644 (file)
@@ -31,8 +31,8 @@ fn get_lints(&self) -> LintArray {
 }
 
 #[allow(match_same_arms)]
-impl LateLintPass for NegMultiply {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NegMultiply {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
         if let ExprBinary(Spanned { node: BiMul, .. }, ref l, ref r) = e.node {
             match (&l.node, &r.node) {
                 (&ExprUnary(..), &ExprUnary(..)) => (),
index 836a5393a9d75cd66d3d27342e18e3453bde5e86..f4a7ebee590f9f91cb0cc7e38ecf09a81e7c5168 100644 (file)
@@ -89,8 +89,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for NewWithoutDefault {
-    fn check_fn<'a, 'tcx: 'a>(
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
+    fn check_fn(
         &mut self,
         cx: &LateContext<'a, 'tcx>,
         kind: FnKind<'tcx>,
index 0a5c21114fb54707333c3b5b6334712155330030..4a4b73b697f82cee0e8e9fa9225f149e5fed786f 100644 (file)
@@ -102,8 +102,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_stmt<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, stmt: &'tcx Stmt) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_stmt(&mut self, cx: &LateContext<'a, 'tcx>, stmt: &'tcx Stmt) {
         if let StmtSemi(ref expr, _) = stmt.node {
             if has_no_effect(cx, expr) {
                 span_lint(cx, NO_EFFECT, stmt.span, "statement with no effect");
index 77244acb308140557ff1bb6561b04e79a9713eb4..6ac49c1f575d0886c23ae6141396f28d00140120 100644 (file)
@@ -40,8 +40,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if_let_chain! {[ //begin checking variables
             let ExprMatch(ref op, ref body, ref source) = expr.node, //test if expr is a match
             let MatchSource::IfLetDesugar { .. } = *source, //test if it is an If Let
index 538d09d082ee0682c64891d6416a822e500f7f3c..f102bdcab33d7bf77e1dd983666c8a1b7e44e2a5 100644 (file)
@@ -32,8 +32,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for NonSensical {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonSensical {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
         if let ExprMethodCall(ref name, _, ref arguments) = e.node {
             let (obj_ty, _) = walk_ptrs_ty_depth(cx.tcx.tables().expr_ty(&arguments[0]));
             if &*name.node.as_str() == "open" && match_type(cx, obj_ty, &paths::OPEN_OPTIONS) {
index 583b9315fee8fd95659bd661caa18781c3e4da63..a09ff3bebf6837d86ea4d524beee09775b8b7ec9 100644 (file)
@@ -29,9 +29,9 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for OverflowCheckConditional {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for OverflowCheckConditional {
     // a + b < a, a > a + b, a < a - b, a - b > a
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if_let_chain! {[
             let Expr_::ExprBinary(ref op, ref first, ref second) = expr.node,
             let Expr_::ExprBinary(ref op2, ref ident1, ref ident2) = first.node,
index 893a17a63fc72d709b1f5dba3975efb91a3dd2b3..3b4fbb3ab1b6da937baaeb9cf2739dd64f3542a2 100644 (file)
@@ -32,8 +32,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if_let_chain! {[
             let ExprBlock(ref block) = expr.node,
             let Some(ref ex) = block.expr,
index 4982055ef3a2e58f924815c83794a34911022762..2677b40f757a9d4d57ce363d9d1b44ae28760321 100644 (file)
@@ -35,8 +35,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
         if_let_chain! {[
             let ItemImpl(_, _, _, Some(ref trait_ref), _, ref impl_items) = item.node,
             !is_automatically_derived(&*item.attrs),
index be70f6a7648f535b5e3d65f879b1ef92d5b6156d..daa55c9675fcb029b6427384ab2bffe37d042b77 100644 (file)
@@ -65,8 +65,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if_let_chain! {[
             let ExprCall(ref fun, ref args) = expr.node,
             let ExprPath(ref qpath) = fun.node,
index a6be3fae45fc3b583f7ec1496c4010d99baa43ea..f1fdc78aca4a46651c1334592204a480c7b375b0 100644 (file)
@@ -54,14 +54,14 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for PointerPass {
-    fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PointerPass {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
         if let ItemFn(ref decl, _, _, _, _, _) = item.node {
             check_fn(cx, decl, item.id);
         }
     }
 
-    fn check_impl_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
+    fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
         if let ImplItemKind::Method(ref sig, _) = item.node {
             if let Some(NodeItem(it)) = cx.tcx.map.find(cx.tcx.map.get_parent(item.id)) {
                 if let ItemImpl(_, _, _, Some(_), _, _) = it.node {
@@ -72,13 +72,13 @@ fn check_impl_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'
         }
     }
 
-    fn check_trait_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
         if let MethodTraitItem(ref sig, _) = item.node {
             check_fn(cx, &sig.decl, item.id);
         }
     }
 
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if let ExprBinary(ref op, ref l, ref r) = expr.node {
             if (op.node == BiEq || op.node == BiNe) && (is_null_path(l) || is_null_path(r)) {
                 span_lint(cx,
index 6936fc1999344f9e9c8a7a1d39caf57730d547c8..78f09700203982fa56262f149ce758aab426774f 100644 (file)
@@ -46,8 +46,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for StepByZero {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for StepByZero {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if let ExprMethodCall(Spanned { node: ref name, .. }, _, ref args) = expr.node {
             let name = &*name.as_str();
 
index d04b03fcf57e18d4d844e4bf44cfd77e33d116d9..6e6b6156d6e69e47c6f7a32879764704b1745fed 100644 (file)
@@ -82,12 +82,12 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_crate<'a, 'tcx: 'a>(&mut self, _: &LateContext<'a, 'tcx>, _: &'tcx Crate) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_crate(&mut self, _: &LateContext<'a, 'tcx>, _: &'tcx Crate) {
         self.spans.clear();
     }
 
-    fn check_block<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, block: &'tcx Block) {
+    fn check_block(&mut self, cx: &LateContext<'a, 'tcx>, block: &'tcx Block) {
         if_let_chain!{[
             self.last.is_none(),
             let Some(ref expr) = block.expr,
@@ -106,13 +106,13 @@ fn check_block<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, block: &'tcx
         }}
     }
 
-    fn check_block_post<'a, 'tcx: 'a>(&mut self, _: &LateContext<'a, 'tcx>, block: &'tcx Block) {
+    fn check_block_post(&mut self, _: &LateContext<'a, 'tcx>, block: &'tcx Block) {
         if self.last.map_or(false, |id| block.id == id) {
             self.last = None;
         }
     }
 
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if_let_chain!{[
             let ExprCall(ref fun, ref args) = expr.node,
             let ExprPath(ref qpath) = fun.node,
index 97a0e0052b5881961ccb9de04ac7dad2781918ce..ec4bce5570618a8db30f26c05e55f739627cf724 100644 (file)
@@ -26,8 +26,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Serde {
-    fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Serde {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
         if let ItemImpl(_, _, _, Some(ref trait_ref), _, ref items) = item.node {
             let did = trait_ref.path.def.def_id();
             if let Some(visit_did) = get_trait_def_id(cx, &paths::SERDE_DE_VISITOR) {
index 9ec4ceba7e67cee1b21c408931a6c95bbeebb123..2d32a87927415bf97028c25a65d45877005badcd 100644 (file)
@@ -79,8 +79,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_fn<'a, 'tcx: 'a>(
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_fn(
         &mut self,
         cx: &LateContext<'a, 'tcx>,
         _: FnKind<'tcx>,
@@ -96,7 +96,7 @@ fn check_fn<'a, 'tcx: 'a>(
     }
 }
 
-fn check_fn<'a, 'tcx: 'a>(cx: &LateContext<'a, 'tcx>, decl: &'tcx FnDecl, expr: &'tcx Expr) {
+fn check_fn<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, decl: &'tcx FnDecl, expr: &'tcx Expr) {
     let mut bindings = Vec::new();
     for arg in &decl.inputs {
         if let PatKind::Binding(_, _, ident, _) = arg.pat.node {
@@ -106,7 +106,7 @@ fn check_fn<'a, 'tcx: 'a>(cx: &LateContext<'a, 'tcx>, decl: &'tcx FnDecl, expr:
     check_expr(cx, expr, &mut bindings);
 }
 
-fn check_block<'a, 'tcx: 'a>(cx: &LateContext<'a, 'tcx>, block: &'tcx Block, bindings: &mut Vec<(Name, Span)>) {
+fn check_block<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, block: &'tcx Block, bindings: &mut Vec<(Name, Span)>) {
     let len = bindings.len();
     for stmt in &block.stmts {
         match stmt.node {
@@ -121,7 +121,7 @@ fn check_block<'a, 'tcx: 'a>(cx: &LateContext<'a, 'tcx>, block: &'tcx Block, bin
     bindings.truncate(len);
 }
 
-fn check_decl<'a, 'tcx: 'a>(cx: &LateContext<'a, 'tcx>, decl: &'tcx Decl, bindings: &mut Vec<(Name, Span)>) {
+fn check_decl<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, decl: &'tcx Decl, bindings: &mut Vec<(Name, Span)>) {
     if in_external_macro(cx, decl.span) {
         return;
     }
@@ -150,7 +150,7 @@ fn is_binding(cx: &LateContext, pat_id: NodeId) -> bool {
     }
 }
 
-fn check_pat<'a, 'tcx: 'a>(
+fn check_pat<'a, 'tcx>(
     cx: &LateContext<'a, 'tcx>,
     pat: &'tcx Pat,
     init: Option<&'tcx Expr>,
@@ -285,7 +285,7 @@ fn lint_shadow<'a, 'tcx: 'a>(
     }
 }
 
-fn check_expr<'a, 'tcx: 'a>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr, bindings: &mut Vec<(Name, Span)>) {
+fn check_expr<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr, bindings: &mut Vec<(Name, Span)>) {
     if in_external_macro(cx, expr.span) {
         return;
     }
@@ -334,7 +334,7 @@ fn check_expr<'a, 'tcx: 'a>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr, bindin
     }
 }
 
-fn check_ty<'a, 'tcx: 'a>(cx: &LateContext<'a, 'tcx>, ty: &'tcx Ty, bindings: &mut Vec<(Name, Span)>) {
+fn check_ty<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: &'tcx Ty, bindings: &mut Vec<(Name, Span)>) {
     match ty.node {
         TyObjectSum(ref sty, _) |
         TySlice(ref sty) => check_ty(cx, sty, bindings),
index 985ef912dc1cf303ad5092becc657073cae2657f..01f2f66c2fdebd640475fc79779aece980c56375 100644 (file)
@@ -79,8 +79,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for StringAdd {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for StringAdd {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
         if let ExprBinary(Spanned { node: BiAdd, .. }, ref left, _) = e.node {
             if is_string(cx, left) {
                 if let Allow = cx.current_level(STRING_ADD_ASSIGN) {
@@ -136,8 +136,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for StringLitAsBytes {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for StringLitAsBytes {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
         use std::ascii::AsciiExt;
         use syntax::ast::LitKind;
         use utils::{snippet, in_macro};
index f251db2b1870c1d2c46d2900b8936dda42dfecd1..7393ee3890e5cf35670c6f1836edaa757dbecf9b 100644 (file)
@@ -50,8 +50,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Swap {
-    fn check_block<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, block: &'tcx Block) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Swap {
+    fn check_block(&mut self, cx: &LateContext<'a, 'tcx>, block: &'tcx Block) {
         check_manual_swap(cx, block);
         check_suspicious_swap(cx, block);
     }
index c6246fec9b0f244dd08dd286e210ed9b1a53e238..2f6e6d97fbf7ef5566354397905c3adecd802f70 100644 (file)
@@ -37,8 +37,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if let ExprAssign(ref target, _) = expr.node {
             match target.node {
                 ExprField(ref base, _) |
index 2d09c725fb0d0a202ff752ebc713d94bef66deac..b6731db93839cac2aab4823a9e3d5f6a5ffd4e4a 100644 (file)
@@ -84,8 +84,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Transmute {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Transmute {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
         if let ExprCall(ref path_expr, ref args) = e.node {
             if let ExprPath(ref qpath) = path_expr.node {
                 let def_id = cx.tcx.tables().qpath_def(qpath, path_expr.id).def_id();
index 66c14e70e6a5d00294f9a49d8961b459a27b4f01..d2bc850e2078ddc217e935894334c26dd20c51ee 100644 (file)
@@ -69,8 +69,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for TypePass {
-    fn check_ty<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, ast_ty: &'tcx Ty) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypePass {
+    fn check_ty(&mut self, cx: &LateContext<'a, 'tcx>, ast_ty: &'tcx Ty) {
         if in_macro(cx, ast_ty.span) {
             return;
         }
@@ -153,8 +153,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for LetPass {
-    fn check_decl<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, decl: &'tcx Decl) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LetPass {
+    fn check_decl(&mut self, cx: &LateContext<'a, 'tcx>, decl: &'tcx Decl) {
         check_let_unit(cx, decl)
     }
 }
@@ -190,8 +190,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for UnitCmp {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnitCmp {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if in_macro(cx, expr.span) {
             return;
         }
@@ -447,8 +447,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for CastPass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CastPass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if let ExprCast(ref ex, _) = expr.node {
             let (cast_from, cast_to) = (cx.tcx.tables().expr_ty(ex), cx.tcx.tables().expr_ty(expr));
             if cast_from.is_numeric() && cast_to.is_numeric() && !in_external_macro(cx, expr.span) {
@@ -535,17 +535,17 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for TypeComplexityPass {
-    fn check_fn<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, _: FnKind<'tcx>, decl: &'tcx FnDecl, _: &'tcx Expr, _: Span, _: NodeId) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeComplexityPass {
+    fn check_fn(&mut self, cx: &LateContext<'a, 'tcx>, _: FnKind<'tcx>, decl: &'tcx FnDecl, _: &'tcx Expr, _: Span, _: NodeId) {
         self.check_fndecl(cx, decl);
     }
 
-    fn check_struct_field<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, field: &'tcx StructField) {
+    fn check_struct_field(&mut self, cx: &LateContext<'a, 'tcx>, field: &'tcx StructField) {
         // enum variants are also struct fields now
         self.check_type(cx, &field.ty);
     }
 
-    fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
         match item.node {
             ItemStatic(ref ty, _, _) |
             ItemConst(ref ty, _) => self.check_type(cx, ty),
@@ -554,7 +554,7 @@ fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx I
         }
     }
 
-    fn check_trait_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
         match item.node {
             ConstTraitItem(ref ty, _) |
             TypeTraitItem(_, Some(ref ty)) => self.check_type(cx, ty),
@@ -564,7 +564,7 @@ fn check_trait_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &
         }
     }
 
-    fn check_impl_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
+    fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
         match item.node {
             ImplItemKind::Const(ref ty, _) |
             ImplItemKind::Type(ref ty) => self.check_type(cx, ty),
@@ -573,15 +573,15 @@ fn check_impl_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'
         }
     }
 
-    fn check_local<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, local: &'tcx Local) {
+    fn check_local(&mut self, cx: &LateContext<'a, 'tcx>, local: &'tcx Local) {
         if let Some(ref ty) = local.ty {
             self.check_type(cx, ty);
         }
     }
 }
 
-impl TypeComplexityPass {
-    fn check_fndecl<'a, 'tcx: 'a>(&self, cx: &LateContext<'a, 'tcx>, decl: &'tcx FnDecl) {
+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.ty);
         }
@@ -590,7 +590,7 @@ fn check_fndecl<'a, 'tcx: 'a>(&self, cx: &LateContext<'a, 'tcx>, decl: &'tcx FnD
         }
     }
 
-    fn check_type<'a, 'tcx: 'a>(&self, cx: &LateContext<'a, 'tcx>, ty: &'tcx Ty) {
+    fn check_type(&self, cx: &LateContext<'a, 'tcx>, ty: &'tcx Ty) {
         if in_macro(cx, ty.span) {
             return;
         }
@@ -682,8 +682,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for CharLitAsU8 {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CharLitAsU8 {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         use syntax::ast::{LitKind, UintTy};
 
         if let ExprCast(ref e, _) = expr.node {
@@ -846,8 +846,8 @@ fn detect_extreme_expr<'a>(cx: &LateContext, expr: &'a Expr) -> Option<ExtremeEx
     })
 }
 
-impl LateLintPass for AbsurdExtremeComparisons {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AbsurdExtremeComparisons {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         use types::ExtremeType::*;
         use types::AbsurdComparisonResult::*;
 
@@ -1071,8 +1071,8 @@ fn upcast_comparison_bounds_err(cx: &LateContext, span: &Span, rel: comparisons:
     }
 }
 
-impl LateLintPass for InvalidUpcastComparisons {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidUpcastComparisons {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if let ExprBinary(ref cmp, ref lhs, ref rhs) = expr.node {
 
             let normalized = comparisons::normalize_comparison(cmp.node, lhs, rhs);
index ba82bc470dcab04b05790b431c1ebf262e343642..1d5ab7db3461c2749f857305df20031303125150 100644 (file)
@@ -68,8 +68,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Unicode {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Unicode {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if let ExprLit(ref lit) = expr.node {
             if let LitKind::Str(_, _) = lit.node {
                 check_str(cx, lit.span)
index 8119c4d727abb6ca1041ca5cf3fc2813147fbe5a..4f1e01af6e9f1e0458269a4c17f977a4fbb8a858 100644 (file)
@@ -40,8 +40,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for UnusedLabel {
-    fn check_fn<'a, 'tcx: 'a>(
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedLabel {
+    fn check_fn(
         &mut self,
         cx: &LateContext<'a, 'tcx>,
         kind: FnKind<'tcx>,
index ef98247b7e83b72a477f0f03f1153fdd1b0463f4..b2900c5691c7caa838785565fb27a724f0349586 100644 (file)
@@ -36,15 +36,15 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
         if !has_attr(&item.attrs) {
             return;
         }
         print_item(cx, item);
     }
 
-    fn check_impl_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::ImplItem) {
+    fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::ImplItem) {
         if !has_attr(&item.attrs) {
             return;
         }
@@ -68,33 +68,33 @@ fn check_impl_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'
         }
     }
 /*
-    fn check_trait_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::TraitItem) {
         if !has_attr(&item.attrs) {
             return;
         }
     }
 
-    fn check_variant<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, var: &'tcx hir::Variant, _: &hir::Generics) {
+    fn check_variant(&mut self, cx: &LateContext<'a, 'tcx>, var: &'tcx hir::Variant, _: &hir::Generics) {
         if !has_attr(&var.node.attrs) {
             return;
         }
     }
 
-    fn check_struct_field<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, field: &'tcx hir::StructField) {
+    fn check_struct_field(&mut self, cx: &LateContext<'a, 'tcx>, field: &'tcx hir::StructField) {
         if !has_attr(&field.attrs) {
             return;
         }
     }
 */
 
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
         if !has_attr(&expr.attrs) {
             return;
         }
         print_expr(cx, expr, 0);
     }
 
-    fn check_arm<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, arm: &'tcx hir::Arm) {
+    fn check_arm(&mut self, cx: &LateContext<'a, 'tcx>, arm: &'tcx hir::Arm) {
         if !has_attr(&arm.attrs) {
             return;
         }
@@ -109,7 +109,7 @@ fn check_arm<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, arm: &'tcx hir
         print_expr(cx, &arm.body, 1);
     }
 
-    fn check_stmt<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, stmt: &'tcx hir::Stmt) {
+    fn check_stmt(&mut self, cx: &LateContext<'a, 'tcx>, stmt: &'tcx hir::Stmt) {
         if !has_attr(stmt.node.attrs()) {
             return;
         }
@@ -120,7 +120,7 @@ fn check_stmt<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, stmt: &'tcx h
     }
 /*
 
-    fn check_foreign_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::ForeignItem) {
+    fn check_foreign_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::ForeignItem) {
         if !has_attr(&item.attrs) {
             return;
         }
index c2e55862b3db594c84178b157199ccc2c1d91aad..91961f90691952afad20a7e7b3161283dfd0105a 100644 (file)
@@ -104,8 +104,8 @@ fn get_lints(&self) -> LintArray {
 }
 
 
-impl LateLintPass for LintWithoutLintPass {
-    fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LintWithoutLintPass {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
         if let ItemStatic(ref ty, MutImmutable, ref expr) = item.node {
             if is_lint_ref_type(ty) {
                 self.declared_lints.insert(item.name, item.span);
@@ -116,7 +116,7 @@ fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx I
         }
     }
 
-    fn check_crate_post<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, _: &'tcx Crate) {
+    fn check_crate_post(&mut self, cx: &LateContext<'a, 'tcx>, _: &'tcx Crate) {
         for (lint_name, &lint_span) in &self.declared_lints {
             // When using the `declare_lint!` macro, the original `lint_span`'s
             // file points to "<rustc macros>".
index bed98559e6f0d627e111965703aa143068bd28c2..1cfb57496f7ab22963d15fca46b29658ed1332ef 100644 (file)
@@ -32,8 +32,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         // search for `&vec![_]` expressions where the adjusted type is `&[_]`
         if_let_chain!{[
             let ty::TypeVariants::TyRef(_, ref ty) = cx.tcx.tables().expr_ty_adjusted(expr).sty,
index b0cc96f3d64bdf7ebf61e560fd2412193370c521..daf0721af05aed7fd62358e08ba760b0d778a307 100644 (file)
@@ -27,8 +27,8 @@ fn get_lints(&self) -> LintArray {
     }
 }
 
-impl LateLintPass for Pass {
-    fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
+    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         // check for instances of 0.0/0.0
         if_let_chain! {[
             let ExprBinary(ref op, ref left, ref right) = expr.node,