diff options
| author | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2016-12-07 13:56:36 +0100 |
|---|---|---|
| committer | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2016-12-07 13:56:36 +0100 |
| commit | 0f7a18b85d89737a3aab62982ac754ec25ada503 (patch) | |
| tree | e4b12682c4589058c6d5f6153e451db981f8d687 | |
| parent | 5beeb1eec7c325428f1a1cd6fb1a95c45256e9f8 (diff) | |
| download | rust-0f7a18b85d89737a3aab62982ac754ec25ada503.tar.gz rust-0f7a18b85d89737a3aab62982ac754ec25ada503.zip | |
remove useless lifetimes on LateLintPass impl methods
| -rw-r--r-- | src/librustc_lint/bad_style.rs | 54 | ||||
| -rw-r--r-- | src/librustc_lint/builtin.rs | 108 | ||||
| -rw-r--r-- | src/librustc_lint/types.rs | 6 | ||||
| -rw-r--r-- | src/librustc_lint/unused.rs | 28 | ||||
| -rw-r--r-- | src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass-fulldeps/auxiliary/lint_group_plugin_test.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass-fulldeps/issue-37290/auxiliary/lint.rs | 4 |
9 files changed, 90 insertions, 118 deletions
diff --git a/src/librustc_lint/bad_style.rs b/src/librustc_lint/bad_style.rs index 4bdd78d55b1..2aa74407afc 100644 --- a/src/librustc_lint/bad_style.rs +++ b/src/librustc_lint/bad_style.rs @@ -100,7 +100,7 @@ impl LintPass for NonCamelCaseTypes { } 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonCamelCaseTypes { } } - 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 @@ impl LintPass for NonSnakeCase { } 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonSnakeCase { } 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonSnakeCase { } } - 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonSnakeCase { } } - 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonSnakeCase { } 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 @@ impl LintPass for NonUpperCaseGlobals { } 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonUpperCaseGlobals { } } - 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonUpperCaseGlobals { } } - 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonUpperCaseGlobals { } } - 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() { diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index ed6eaf0171d..744b08a2a89 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -70,7 +70,7 @@ impl LintPass for WhileTrue { } 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 @@ declare_lint! { 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 @@ impl LintPass for BoxPointers { } 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxPointers { } } - 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 @@ impl LintPass for NonShorthandFieldPatterns { } 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 @@ impl LintPass for UnsafeCode { } 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnsafeCode { } } - 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnsafeCode { } 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnsafeCode { } } - 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 @@ impl LintPass for MissingDoc { } 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc { 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc { 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc { 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc { 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc { } } - 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc { 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 @@ impl LintPass for MissingCopyImplementations { } 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 @@ impl LintPass for MissingDebugImplementations { } 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 @@ impl LintPass for UnconditionalRecursion { 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 @@ impl LintPass for PluginAsLibrary { } 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 @@ impl LintPass for InvalidNoMangleItems { } 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 @@ impl LintPass for MutableTransmutes { } 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 @@ impl LintPass for UnstableFeatures { } 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 @@ impl LintPass for UnionsWithDropFields { } 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() { diff --git a/src/librustc_lint/types.rs b/src/librustc_lint/types.rs index 98b87a141ea..8470f063f47 100644 --- a/src/librustc_lint/types.rs +++ b/src/librustc_lint/types.rs @@ -104,7 +104,7 @@ impl LintPass for TypeLimits { } 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 @@ impl LintPass for ImproperCTypes { } 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 @@ impl LintPass for VariantSizeDifferences { } 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 diff --git a/src/librustc_lint/unused.rs b/src/librustc_lint/unused.rs index 89f8f464ee7..429bfb8e3d6 100644 --- a/src/librustc_lint/unused.rs +++ b/src/librustc_lint/unused.rs @@ -78,7 +78,7 @@ impl LintPass for UnusedMut { } 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedMut { } } - 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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedMut { } 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 @@ impl LintPass for UnusedResults { } 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 @@ impl LintPass for UnusedUnsafe { } 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 @@ impl LintPass for PathStatements { } 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 @@ impl LintPass for UnusedAttributes { } 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 @@ impl LintPass for UnusedAllocation { } 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, diff --git a/src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs b/src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs index 4011ce86414..fc53031e7f2 100644 --- a/src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs +++ b/src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs @@ -33,7 +33,7 @@ impl LintPass for Pass { } 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]"); diff --git a/src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs b/src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs index cc17a011e55..490aa0d4693 100644 --- a/src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs +++ b/src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs @@ -35,7 +35,7 @@ impl LintPass for Pass { } 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'"), diff --git a/src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs b/src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs index 4011ce86414..fc53031e7f2 100644 --- a/src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs +++ b/src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs @@ -33,7 +33,7 @@ impl LintPass for Pass { } 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]"); diff --git a/src/test/run-pass-fulldeps/auxiliary/lint_group_plugin_test.rs b/src/test/run-pass-fulldeps/auxiliary/lint_group_plugin_test.rs index cc17a011e55..490aa0d4693 100644 --- a/src/test/run-pass-fulldeps/auxiliary/lint_group_plugin_test.rs +++ b/src/test/run-pass-fulldeps/auxiliary/lint_group_plugin_test.rs @@ -35,7 +35,7 @@ impl LintPass for Pass { } 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'"), diff --git a/src/test/run-pass-fulldeps/issue-37290/auxiliary/lint.rs b/src/test/run-pass-fulldeps/issue-37290/auxiliary/lint.rs index 77996b71a46..c6892757c68 100644 --- a/src/test/run-pass-fulldeps/issue-37290/auxiliary/lint.rs +++ b/src/test/run-pass-fulldeps/issue-37290/auxiliary/lint.rs @@ -40,8 +40,8 @@ impl LintPass for Pass { } 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 } |
