]> git.lizzy.rs Git - rust.git/commitdiff
remove useless lifetimes on LateLintPass impl methods
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Wed, 7 Dec 2016 12:56:36 +0000 (13:56 +0100)
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Wed, 7 Dec 2016 12:56:36 +0000 (13:56 +0100)
src/librustc_lint/bad_style.rs
src/librustc_lint/builtin.rs
src/librustc_lint/types.rs
src/librustc_lint/unused.rs
src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs
src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs
src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs
src/test/run-pass-fulldeps/auxiliary/lint_group_plugin_test.rs
src/test/run-pass-fulldeps/issue-37290/auxiliary/lint.rs

index 4bdd78d55b1a38b389517069484ab8ee213b446b..2aa74407afc5b087fe64c4804f1e0b279b4e3e1d 100644 (file)
@@ -100,7 +100,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonCamelCaseTypes {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
         let extern_repr_count = it.attrs
             .iter()
             .filter(|attr| {
@@ -133,9 +133,7 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
         }
     }
 
-    fn check_generics(&mut self,
-                                    cx: &LateContext<'a, 'tcx>,
-                                    it: &'tcx hir::Generics) {
+    fn check_generics(&mut self, cx: &LateContext, it: &hir::Generics) {
         for gen in it.ty_params.iter() {
             self.check_case(cx, "type parameter", gen.name, gen.span);
         }
@@ -229,7 +227,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonSnakeCase {
-    fn check_crate(&mut self, cx: &LateContext<'a, 'tcx>, cr: &'tcx hir::Crate) {
+    fn check_crate(&mut self, cx: &LateContext, cr: &hir::Crate) {
         let attr_crate_name = cr.attrs
             .iter()
             .find(|at| at.check_name("crate_name"))
@@ -242,12 +240,12 @@ fn check_crate(&mut self, cx: &LateContext<'a, 'tcx>, cr: &'tcx hir::Crate) {
     }
 
     fn check_fn(&mut self,
-                              cx: &LateContext<'a, 'tcx>,
-                              fk: FnKind,
-                              _: &'tcx hir::FnDecl,
-                              _: &'tcx hir::Expr,
-                              span: Span,
-                              id: ast::NodeId) {
+                cx: &LateContext,
+                fk: FnKind,
+                _: &hir::FnDecl,
+                _: &hir::Expr,
+                span: Span,
+                id: ast::NodeId) {
         match fk {
             FnKind::Method(name, ..) => {
                 match method_context(cx, id, span) {
@@ -267,15 +265,13 @@ fn check_fn(&mut self,
         }
     }
 
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
         if let hir::ItemMod(_) = it.node {
             self.check_snake_case(cx, "module", &it.name.as_str(), Some(it.span));
         }
     }
 
-    fn check_trait_item(&mut self,
-                                      cx: &LateContext<'a, 'tcx>,
-                                      trait_item: &'tcx hir::TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext, trait_item: &hir::TraitItem) {
         if let hir::MethodTraitItem(_, None) = trait_item.node {
             self.check_snake_case(cx,
                                   "trait method",
@@ -284,16 +280,14 @@ fn check_trait_item(&mut self,
         }
     }
 
-    fn check_lifetime_def(&mut self,
-                                        cx: &LateContext<'a, 'tcx>,
-                                        t: &'tcx hir::LifetimeDef) {
+    fn check_lifetime_def(&mut self, cx: &LateContext, t: &hir::LifetimeDef) {
         self.check_snake_case(cx,
                               "lifetime",
                               &t.lifetime.name.as_str(),
                               Some(t.lifetime.span));
     }
 
-    fn check_pat(&mut self, cx: &LateContext<'a, 'tcx>, p: &'tcx hir::Pat) {
+    fn check_pat(&mut self, cx: &LateContext, p: &hir::Pat) {
         // Exclude parameter names from foreign functions
         let parent_node = cx.tcx.map.get_parent_node(p.id);
         if let hir::map::NodeForeignItem(item) = cx.tcx.map.get(parent_node) {
@@ -308,11 +302,11 @@ fn check_pat(&mut self, cx: &LateContext<'a, 'tcx>, p: &'tcx hir::Pat) {
     }
 
     fn check_struct_def(&mut self,
-                                      cx: &LateContext<'a, 'tcx>,
-                                      s: &'tcx hir::VariantData,
-                                      _: ast::Name,
-                                      _: &'tcx hir::Generics,
-                                      _: ast::NodeId) {
+                        cx: &LateContext,
+                        s: &hir::VariantData,
+                        _: ast::Name,
+                        _: &hir::Generics,
+                        _: ast::NodeId) {
         for sf in s.fields() {
             self.check_snake_case(cx, "structure field", &sf.name.as_str(), Some(sf.span));
         }
@@ -355,7 +349,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonUpperCaseGlobals {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
         match it.node {
             hir::ItemStatic(..) => {
                 NonUpperCaseGlobals::check_upper_case(cx, "static variable", it.name, it.span);
@@ -367,9 +361,7 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
         }
     }
 
-    fn check_trait_item(&mut self,
-                                      cx: &LateContext<'a, 'tcx>,
-                                      ti: &'tcx hir::TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext, ti: &hir::TraitItem) {
         match ti.node {
             hir::ConstTraitItem(..) => {
                 NonUpperCaseGlobals::check_upper_case(cx, "associated constant", ti.name, ti.span);
@@ -378,9 +370,7 @@ fn check_trait_item(&mut self,
         }
     }
 
-    fn check_impl_item(&mut self,
-                                     cx: &LateContext<'a, 'tcx>,
-                                     ii: &'tcx hir::ImplItem) {
+    fn check_impl_item(&mut self, cx: &LateContext, ii: &hir::ImplItem) {
         match ii.node {
             hir::ImplItemKind::Const(..) => {
                 NonUpperCaseGlobals::check_upper_case(cx, "associated constant", ii.name, ii.span);
@@ -389,7 +379,7 @@ fn check_impl_item(&mut self,
         }
     }
 
-    fn check_pat(&mut self, cx: &LateContext<'a, 'tcx>, p: &'tcx hir::Pat) {
+    fn check_pat(&mut self, cx: &LateContext, p: &hir::Pat) {
         // Lint for constants that look like binding identifiers (#7526)
         if let PatKind::Path(hir::QPath::Resolved(None, ref path)) = p.node {
             if !path.global && path.segments.len() == 1 && path.segments[0].parameters.is_empty() {
index ed6eaf0171de1ed9bf56019efb27215f4925dd03..744b08a2a8900d95f55ed3a9f24fa9dbb9717fae 100644 (file)
@@ -70,7 +70,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for WhileTrue {
-    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx hir::Expr) {
+    fn check_expr(&mut self, cx: &LateContext, e: &hir::Expr) {
         if let hir::ExprWhile(ref cond, ..) = e.node {
             if let hir::ExprLit(ref lit) = cond.node {
                 if let ast::LitKind::Bool(true) = lit.node {
@@ -93,7 +93,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx hir::Expr) {
 pub struct BoxPointers;
 
 impl BoxPointers {
-    fn check_heap_type<'a, 'tcx>(&self, cx: &LateContext<'a, 'tcx>, span: Span, ty: Ty<'tcx>) {
+    fn check_heap_type<'a, 'tcx>(&self, cx: &LateContext, span: Span, ty: Ty) {
         for leaf_ty in ty.walk() {
             if let ty::TyBox(_) = leaf_ty.sty {
                 let m = format!("type uses owned (Box type) pointers: {}", ty);
@@ -110,7 +110,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxPointers {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
         match it.node {
             hir::ItemFn(..) |
             hir::ItemTy(..) |
@@ -137,7 +137,7 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
         }
     }
 
-    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx hir::Expr) {
+    fn check_expr(&mut self, cx: &LateContext, e: &hir::Expr) {
         let ty = cx.tcx.tables().node_id_to_type(e.id);
         self.check_heap_type(cx, e.span, ty);
     }
@@ -159,7 +159,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonShorthandFieldPatterns {
-    fn check_pat(&mut self, cx: &LateContext<'a, 'tcx>, pat: &'tcx hir::Pat) {
+    fn check_pat(&mut self, cx: &LateContext, pat: &hir::Pat) {
         if let PatKind::Struct(_, ref field_pats, _) = pat.node {
             for fieldpat in field_pats {
                 if fieldpat.node.is_shorthand {
@@ -195,7 +195,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnsafeCode {
-    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx hir::Expr) {
+    fn check_expr(&mut self, cx: &LateContext, e: &hir::Expr) {
         if let hir::ExprBlock(ref blk) = e.node {
             // Don't warn about generated blocks, that'll just pollute the output.
             if blk.rules == hir::UnsafeBlock(hir::UserProvided) {
@@ -204,7 +204,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx hir::Expr) {
         }
     }
 
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
         match it.node {
             hir::ItemTrait(hir::Unsafety::Unsafe, ..) => {
                 cx.span_lint(UNSAFE_CODE, it.span, "declaration of an `unsafe` trait")
@@ -219,12 +219,12 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
     }
 
     fn check_fn(&mut self,
-                              cx: &LateContext<'a, 'tcx>,
-                              fk: FnKind<'tcx>,
-                              _: &'tcx hir::FnDecl,
-                              _: &'tcx hir::Expr,
-                              span: Span,
-                              _: ast::NodeId) {
+                cx: &LateContext,
+                fk: FnKind<'tcx>,
+                _: &hir::FnDecl,
+                _: &hir::Expr,
+                span: Span,
+                _: ast::NodeId) {
         match fk {
             FnKind::ItemFn(_, _, hir::Unsafety::Unsafe, ..) => {
                 cx.span_lint(UNSAFE_CODE, span, "declaration of an `unsafe` function")
@@ -240,9 +240,7 @@ fn check_fn(&mut self,
         }
     }
 
-    fn check_trait_item(&mut self,
-                                      cx: &LateContext<'a, 'tcx>,
-                                      trait_item: &'tcx hir::TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext, trait_item: &hir::TraitItem) {
         if let hir::MethodTraitItem(ref sig, None) = trait_item.node {
             if sig.unsafety == hir::Unsafety::Unsafe {
                 cx.span_lint(UNSAFE_CODE,
@@ -330,7 +328,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
-    fn enter_lint_attrs(&mut self, _: &LateContext<'a, 'tcx>, attrs: &'tcx [ast::Attribute]) {
+    fn enter_lint_attrs(&mut self, _: &LateContext, attrs: &[ast::Attribute]) {
         let doc_hidden = self.doc_hidden() ||
                          attrs.iter().any(|attr| {
             attr.check_name("doc") &&
@@ -342,34 +340,34 @@ fn enter_lint_attrs(&mut self, _: &LateContext<'a, 'tcx>, attrs: &'tcx [ast::Att
         self.doc_hidden_stack.push(doc_hidden);
     }
 
-    fn exit_lint_attrs(&mut self, _: &LateContext<'a, 'tcx>, _attrs: &'tcx [ast::Attribute]) {
+    fn exit_lint_attrs(&mut self, _: &LateContext, _attrs: &[ast::Attribute]) {
         self.doc_hidden_stack.pop().expect("empty doc_hidden_stack");
     }
 
     fn check_struct_def(&mut self,
-                                      _: &LateContext<'a, 'tcx>,
-                                      _: &'tcx hir::VariantData,
-                                      _: ast::Name,
-                                      _: &'tcx hir::Generics,
-                                      item_id: ast::NodeId) {
+                        _: &LateContext,
+                        _: &hir::VariantData,
+                        _: ast::Name,
+                        _: &hir::Generics,
+                        item_id: ast::NodeId) {
         self.struct_def_stack.push(item_id);
     }
 
     fn check_struct_def_post(&mut self,
-                                           _: &LateContext<'a, 'tcx>,
-                                           _: &'tcx hir::VariantData,
-                                           _: ast::Name,
-                                           _: &'tcx hir::Generics,
-                                           item_id: ast::NodeId) {
+                             _: &LateContext,
+                             _: &hir::VariantData,
+                             _: ast::Name,
+                             _: &hir::Generics,
+                             item_id: ast::NodeId) {
         let popped = self.struct_def_stack.pop().expect("empty struct_def_stack");
         assert!(popped == item_id);
     }
 
-    fn check_crate(&mut self, cx: &LateContext<'a, 'tcx>, krate: &'tcx hir::Crate) {
+    fn check_crate(&mut self, cx: &LateContext, krate: &hir::Crate) {
         self.check_missing_docs_attrs(cx, None, &krate.attrs, krate.span, "crate");
     }
 
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
         let desc = match it.node {
             hir::ItemFn(..) => "a function",
             hir::ItemMod(..) => "a module",
@@ -414,9 +412,7 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
         self.check_missing_docs_attrs(cx, Some(it.id), &it.attrs, it.span, desc);
     }
 
-    fn check_trait_item(&mut self,
-                                      cx: &LateContext<'a, 'tcx>,
-                                      trait_item: &'tcx hir::TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext, trait_item: &hir::TraitItem) {
         if self.private_traits.contains(&trait_item.id) {
             return;
         }
@@ -434,9 +430,7 @@ fn check_trait_item(&mut self,
                                       desc);
     }
 
-    fn check_impl_item(&mut self,
-                                     cx: &LateContext<'a, 'tcx>,
-                                     impl_item: &'tcx hir::ImplItem) {
+    fn check_impl_item(&mut self, cx: &LateContext, impl_item: &hir::ImplItem) {
         // If the method is an impl for a trait, don't doc.
         if method_context(cx, impl_item.id, impl_item.span) == MethodLateContext::TraitImpl {
             return;
@@ -454,9 +448,7 @@ fn check_impl_item(&mut self,
                                       desc);
     }
 
-    fn check_struct_field(&mut self,
-                                        cx: &LateContext<'a, 'tcx>,
-                                        sf: &'tcx hir::StructField) {
+    fn check_struct_field(&mut self, cx: &LateContext, sf: &hir::StructField) {
         if !sf.is_positional() {
             if sf.vis == hir::Public || self.in_variant {
                 let cur_struct_def = *self.struct_def_stack
@@ -471,10 +463,7 @@ fn check_struct_field(&mut self,
         }
     }
 
-    fn check_variant(&mut self,
-                                   cx: &LateContext<'a, 'tcx>,
-                                   v: &'tcx hir::Variant,
-                                   _: &'tcx hir::Generics) {
+    fn check_variant(&mut self, cx: &LateContext, v: &hir::Variant, _: &hir::Generics) {
         self.check_missing_docs_attrs(cx,
                                       Some(v.node.data.id()),
                                       &v.node.attrs,
@@ -484,10 +473,7 @@ fn check_variant(&mut self,
         self.in_variant = true;
     }
 
-    fn check_variant_post(&mut self,
-                                        _: &LateContext<'a, 'tcx>,
-                                        _: &'tcx hir::Variant,
-                                        _: &'tcx hir::Generics) {
+    fn check_variant_post(&mut self, _: &LateContext, _: &hir::Variant, _: &hir::Generics) {
         assert!(self.in_variant);
         self.in_variant = false;
     }
@@ -509,7 +495,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingCopyImplementations {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext, item: &hir::Item) {
         if !cx.access_levels.is_reachable(item.id) {
             return;
         }
@@ -578,7 +564,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDebugImplementations {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext, item: &hir::Item) {
         if !cx.access_levels.is_reachable(item.id) {
             return;
         }
@@ -685,12 +671,12 @@ fn get_lints(&self) -> LintArray {
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnconditionalRecursion {
     fn check_fn(&mut self,
-                              cx: &LateContext<'a, 'tcx>,
-                              fn_kind: FnKind<'tcx>,
-                              _: &'tcx hir::FnDecl,
-                              blk: &'tcx hir::Expr,
-                              sp: Span,
-                              id: ast::NodeId) {
+                cx: &LateContext,
+                fn_kind: FnKind,
+                _: &hir::FnDecl,
+                blk: &hir::Expr,
+                sp: Span,
+                id: ast::NodeId) {
         let method = match fn_kind {
             FnKind::ItemFn(..) => None,
             FnKind::Method(..) => {
@@ -947,7 +933,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PluginAsLibrary {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
         if cx.sess().plugin_registrar_fn.get().is_some() {
             // We're compiling a plugin; it's fine to link other plugins.
             return;
@@ -1013,7 +999,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidNoMangleItems {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
         match it.node {
             hir::ItemFn(.., ref generics, _) => {
                 if attr::contains_name(&it.attrs, "no_mangle") {
@@ -1067,7 +1053,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MutableTransmutes {
-    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
+    fn check_expr(&mut self, cx: &LateContext, expr: &hir::Expr) {
         use syntax::abi::Abi::RustIntrinsic;
 
         let msg = "mutating transmuted &mut T from &T may cause undefined behavior, \
@@ -1135,9 +1121,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnstableFeatures {
-    fn check_attribute(&mut self,
-                                     ctx: &LateContext<'a, 'tcx>,
-                                     attr: &'tcx ast::Attribute) {
+    fn check_attribute(&mut self, ctx: &LateContext, attr: &ast::Attribute) {
         if attr.meta().check_name("feature") {
             if let Some(items) = attr.meta().meta_item_list() {
                 for item in items {
@@ -1164,7 +1148,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnionsWithDropFields {
-    fn check_item(&mut self, ctx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
+    fn check_item(&mut self, ctx: &LateContext, item: &hir::Item) {
         if let hir::ItemUnion(ref vdata, _) = item.node {
             let param_env = &ty::ParameterEnvironment::for_item(ctx.tcx, item.id);
             for field in vdata.fields() {
index 98b87a141ea4a65152ac1fa94d51413ebaba24d4..8470f063f47d794eecf6be9a454571a9ce03ad98 100644 (file)
@@ -104,7 +104,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeLimits {
-    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx hir::Expr) {
+    fn check_expr(&mut self, cx: &LateContext, e: &hir::Expr) {
         match e.node {
             hir::ExprUnary(hir::UnNeg, ref expr) => {
                 if let hir::ExprLit(ref lit) = expr.node {
@@ -707,7 +707,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ImproperCTypes {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
         let mut vis = ImproperCTypesVisitor { cx: cx };
         if let hir::ItemForeignMod(ref nmod) = it.node {
             if nmod.abi != Abi::RustIntrinsic && nmod.abi != Abi::PlatformIntrinsic {
@@ -735,7 +735,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for VariantSizeDifferences {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
         if let hir::ItemEnum(ref enum_definition, ref gens) = it.node {
             if gens.ty_params.is_empty() {
                 // sizes only make sense for non-generic types
index 89f8f464ee79104c0177b4e85919cd3f2ccb3a9f..429bfb8e3d60667bc683ee829c17d5ce76fb7b59 100644 (file)
@@ -78,7 +78,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedMut {
-    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx hir::Expr) {
+    fn check_expr(&mut self, cx: &LateContext, e: &hir::Expr) {
         if let hir::ExprMatch(_, ref arms, _) = e.node {
             for a in arms {
                 self.check_unused_mut_pat(cx, &a.pats)
@@ -86,7 +86,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx hir::Expr) {
         }
     }
 
-    fn check_stmt(&mut self, cx: &LateContext<'a, 'tcx>, s: &'tcx hir::Stmt) {
+    fn check_stmt(&mut self, cx: &LateContext, s: &hir::Stmt) {
         if let hir::StmtDecl(ref d, _) = s.node {
             if let hir::DeclLocal(ref l) = d.node {
                 self.check_unused_mut_pat(cx, slice::ref_slice(&l.pat));
@@ -95,12 +95,12 @@ fn check_stmt(&mut self, cx: &LateContext<'a, 'tcx>, s: &'tcx hir::Stmt) {
     }
 
     fn check_fn(&mut self,
-                              cx: &LateContext<'a, 'tcx>,
-                              _: FnKind<'tcx>,
-                              decl: &'tcx hir::FnDecl,
-                              _: &'tcx hir::Expr,
-                              _: Span,
-                              _: ast::NodeId) {
+                cx: &LateContext,
+                _: FnKind,
+                decl: &hir::FnDecl,
+                _: &hir::Expr,
+                _: Span,
+                _: ast::NodeId) {
         for a in &decl.inputs {
             self.check_unused_mut_pat(cx, slice::ref_slice(&a.pat));
         }
@@ -129,7 +129,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedResults {
-    fn check_stmt(&mut self, cx: &LateContext<'a, 'tcx>, s: &'tcx hir::Stmt) {
+    fn check_stmt(&mut self, cx: &LateContext, s: &hir::Stmt) {
         let expr = match s.node {
             hir::StmtSemi(ref expr, _) => &**expr,
             _ => return,
@@ -188,7 +188,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedUnsafe {
-    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx hir::Expr) {
+    fn check_expr(&mut self, cx: &LateContext, e: &hir::Expr) {
         if let hir::ExprBlock(ref blk) = e.node {
             // Don't warn about generated blocks, that'll just pollute the output.
             if blk.rules == hir::UnsafeBlock(hir::UserProvided) &&
@@ -215,7 +215,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PathStatements {
-    fn check_stmt(&mut self, cx: &LateContext<'a, 'tcx>, s: &'tcx hir::Stmt) {
+    fn check_stmt(&mut self, cx: &LateContext, s: &hir::Stmt) {
         if let hir::StmtSemi(ref expr, _) = s.node {
             if let hir::ExprPath(_) = expr.node {
                 cx.span_lint(PATH_STATEMENTS, s.span, "path statement with no effect");
@@ -240,9 +240,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedAttributes {
-    fn check_attribute(&mut self,
-                                     cx: &LateContext<'a, 'tcx>,
-                                     attr: &'tcx ast::Attribute) {
+    fn check_attribute(&mut self, cx: &LateContext, attr: &ast::Attribute) {
         debug!("checking attribute: {:?}", attr);
 
         // Note that check_name() marks the attribute as used if it matches.
@@ -436,7 +434,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedAllocation {
-    fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx hir::Expr) {
+    fn check_expr(&mut self, cx: &LateContext, e: &hir::Expr) {
         match e.node {
             hir::ExprBox(_) => {}
             _ => return,
index 4011ce86414c6c6d1e084cee453a08e2c19f1ff0..fc53031e7f22662f8e442cd8bcccb9bc86e9d6ea 100644 (file)
@@ -33,7 +33,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
-    fn check_crate(&mut self, cx: &LateContext<'a, 'tcx>, krate: &'tcx hir::Crate) {
+    fn check_crate(&mut self, cx: &LateContext, krate: &hir::Crate) {
         if !attr::contains_name(&krate.attrs, "crate_okay") {
             cx.span_lint(CRATE_NOT_OKAY, krate.span,
                          "crate is not marked with #![crate_okay]");
index cc17a011e5546134fe5e0f1fdc50080d31c8d047..490aa0d469312d30b92af1bf28e57d489634159e 100644 (file)
@@ -35,7 +35,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
         match &*it.name.as_str() {
             "lintme" => cx.span_lint(TEST_LINT, it.span, "item is named 'lintme'"),
             "pleaselintme" => cx.span_lint(PLEASE_LINT, it.span, "item is named 'pleaselintme'"),
index 4011ce86414c6c6d1e084cee453a08e2c19f1ff0..fc53031e7f22662f8e442cd8bcccb9bc86e9d6ea 100644 (file)
@@ -33,7 +33,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
-    fn check_crate(&mut self, cx: &LateContext<'a, 'tcx>, krate: &'tcx hir::Crate) {
+    fn check_crate(&mut self, cx: &LateContext, krate: &hir::Crate) {
         if !attr::contains_name(&krate.attrs, "crate_okay") {
             cx.span_lint(CRATE_NOT_OKAY, krate.span,
                          "crate is not marked with #![crate_okay]");
index cc17a011e5546134fe5e0f1fdc50080d31c8d047..490aa0d469312d30b92af1bf28e57d489634159e 100644 (file)
@@ -35,7 +35,7 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
         match &*it.name.as_str() {
             "lintme" => cx.span_lint(TEST_LINT, it.span, "item is named 'lintme'"),
             "pleaselintme" => cx.span_lint(PLEASE_LINT, it.span, "item is named 'pleaselintme'"),
index 77996b71a46571b7ff6bcc7913069c69f03a0c27..c6892757c682f22cbc4d5d2c60b8d7ab9f69e71d 100644 (file)
@@ -40,8 +40,8 @@ fn get_lints(&self) -> LintArray { lint_array!(REGION_HIERARCHY) }
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
-    fn check_fn(&mut self, cx: &LateContext<'a, 'tcx>,
-                              fk: FnKind<'tcx>, _: &'tcx hir::FnDecl, expr: &'tcx hir::Expr,
+    fn check_fn(&mut self, cx: &LateContext,
+                              fk: FnKind, _: &hir::FnDecl, expr: &hir::Expr,
                               span: Span, node: ast::NodeId)
     {
         if let FnKind::Closure(..) = fk { return }