]> git.lizzy.rs Git - rust.git/commitdiff
Add <'_> where necessary
authorflip1995 <hello@philkrones.com>
Sun, 22 Dec 2019 14:42:41 +0000 (15:42 +0100)
committerflip1995 <hello@philkrones.com>
Sun, 22 Dec 2019 14:42:41 +0000 (15:42 +0100)
46 files changed:
clippy_lints/src/arithmetic.rs
clippy_lints/src/attrs.rs
clippy_lints/src/booleans.rs
clippy_lints/src/cognitive_complexity.rs
clippy_lints/src/copy_iterator.rs
clippy_lints/src/derive.rs
clippy_lints/src/doc.rs
clippy_lints/src/empty_enum.rs
clippy_lints/src/enum_clike.rs
clippy_lints/src/enum_glob_use.rs
clippy_lints/src/escape.rs
clippy_lints/src/fallible_impl_from.rs
clippy_lints/src/functions.rs
clippy_lints/src/implicit_return.rs
clippy_lints/src/inherent_impl.rs
clippy_lints/src/inherent_to_string.rs
clippy_lints/src/inline_fn_without_body.rs
clippy_lints/src/large_enum_variant.rs
clippy_lints/src/len_zero.rs
clippy_lints/src/lifetimes.rs
clippy_lints/src/main_recursion.rs
clippy_lints/src/methods/mod.rs
clippy_lints/src/misc.rs
clippy_lints/src/missing_const_for_fn.rs
clippy_lints/src/missing_doc.rs
clippy_lints/src/missing_inline.rs
clippy_lints/src/needless_borrow.rs
clippy_lints/src/needless_pass_by_value.rs
clippy_lints/src/new_without_default.rs
clippy_lints/src/non_copy_const.rs
clippy_lints/src/partialeq_ne_impl.rs
clippy_lints/src/ptr.rs
clippy_lints/src/redundant_clone.rs
clippy_lints/src/regex.rs
clippy_lints/src/serde_api.rs
clippy_lints/src/shadow.rs
clippy_lints/src/trivially_copy_pass_by_ref.rs
clippy_lints/src/types.rs
clippy_lints/src/unused_self.rs
clippy_lints/src/unwrap.rs
clippy_lints/src/use_self.rs
clippy_lints/src/utils/author.rs
clippy_lints/src/utils/inspector.rs
clippy_lints/src/utils/internal_lints.rs
clippy_lints/src/utils/mod.rs
clippy_lints/src/utils/ptr.rs

index d4402469ad70eafe52de378a90f0110e2de3b94b..7653ba43459f2db068f24be9a778f71b2d65745c 100644 (file)
@@ -113,7 +113,7 @@ fn check_expr_post(&mut self, _: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr)
         }
     }
 
-    fn check_body(&mut self, cx: &LateContext<'_, '_>, body: &hir::Body) {
+    fn check_body(&mut self, cx: &LateContext<'_, '_>, body: &hir::Body<'_>) {
         let body_owner = cx.tcx.hir().body_owner(body.id());
 
         match cx.tcx.hir().body_owner_kind(body_owner) {
@@ -131,7 +131,7 @@ fn check_body(&mut self, cx: &LateContext<'_, '_>, body: &hir::Body) {
         }
     }
 
-    fn check_body_post(&mut self, cx: &LateContext<'_, '_>, body: &hir::Body) {
+    fn check_body_post(&mut self, cx: &LateContext<'_, '_>, body: &hir::Body<'_>) {
         let body_owner = cx.tcx.hir().body_owner(body.id());
         let body_span = cx.tcx.hir().span(body_owner);
 
index 5f500fff1a4c3184eb47f54f471f6bcf40e08d20..e281a39006be209e282b2f7397db1dd58c8acbbf 100644 (file)
@@ -224,7 +224,7 @@ fn check_attribute(&mut self, cx: &LateContext<'a, 'tcx>, attr: &'tcx Attribute)
         }
     }
 
-    fn check_item(&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.ident.name, &item.attrs)
         }
@@ -295,13 +295,13 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
         }
     }
 
-    fn check_impl_item(&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.ident.name, &item.attrs)
         }
     }
 
-    fn check_trait_item(&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.ident.name, &item.attrs)
         }
@@ -355,7 +355,7 @@ fn check_clippy_lint_names(cx: &LateContext<'_, '_>, items: &[NestedMetaItem]) {
     }
 }
 
-fn is_relevant_item(cx: &LateContext<'_, '_>, item: &Item) -> bool {
+fn is_relevant_item(cx: &LateContext<'_, '_>, item: &Item<'_>) -> bool {
     if let ItemKind::Fn(_, _, eid) = item.kind {
         is_relevant_expr(cx, cx.tcx.body_tables(eid), &cx.tcx.hir().body(eid).value)
     } else {
@@ -363,14 +363,14 @@ fn is_relevant_item(cx: &LateContext<'_, '_>, item: &Item) -> bool {
     }
 }
 
-fn is_relevant_impl(cx: &LateContext<'_, '_>, item: &ImplItem) -> bool {
+fn is_relevant_impl(cx: &LateContext<'_, '_>, item: &ImplItem<'_>) -> bool {
     match item.kind {
         ImplItemKind::Method(_, eid) => is_relevant_expr(cx, cx.tcx.body_tables(eid), &cx.tcx.hir().body(eid).value),
         _ => false,
     }
 }
 
-fn is_relevant_trait(cx: &LateContext<'_, '_>, item: &TraitItem) -> bool {
+fn is_relevant_trait(cx: &LateContext<'_, '_>, item: &TraitItem<'_>) -> bool {
     match item.kind {
         TraitItemKind::Method(_, TraitMethod::Required(_)) => true,
         TraitItemKind::Method(_, TraitMethod::Provided(eid)) => {
index 9518bee326af75d286b042ca68c07054cad77606..8767b92b43516ad5dafffc14a56ff94ec5261c4f 100644 (file)
@@ -61,7 +61,7 @@ fn check_fn(
         cx: &LateContext<'a, 'tcx>,
         _: intravisit::FnKind<'tcx>,
         _: &'tcx FnDecl,
-        body: &'tcx Body,
+        body: &'tcx Body<'_>,
         _: Span,
         _: HirId,
     ) {
index 405e7335ed44185243e1a7e1946e886f8ba1d171..a0cb1d633b94885a6006067bd64bca7da2d4506f 100644 (file)
@@ -48,7 +48,7 @@ fn check<'a, 'tcx>(
         cx: &'a LateContext<'a, 'tcx>,
         kind: FnKind<'tcx>,
         decl: &'tcx FnDecl,
-        body: &'tcx Body,
+        body: &'tcx Body<'_>,
         body_span: Span,
     ) {
         if body_span.from_expansion() {
@@ -117,7 +117,7 @@ fn check_fn(
         cx: &LateContext<'a, 'tcx>,
         kind: FnKind<'tcx>,
         decl: &'tcx FnDecl,
-        body: &'tcx Body,
+        body: &'tcx Body<'_>,
         span: Span,
         hir_id: HirId,
     ) {
index 274cf3b419436598533081258d75fb03b83b2d49..c8d8da487856dc0e743031fcda48e08ac144247c 100644 (file)
@@ -33,7 +33,7 @@
 declare_lint_pass!(CopyIterator => [COPY_ITERATOR]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CopyIterator {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
         if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, _) = item.kind {
             let ty = cx.tcx.type_of(cx.tcx.hir().local_def_id(item.hir_id));
 
index 0852580e1ca2e57df220404c9f398bd006a6f7e0..140ad0ddd3da32ec118021e36cdd50c55dc4e870 100644 (file)
@@ -66,7 +66,7 @@
 declare_lint_pass!(Derive => [EXPL_IMPL_CLONE_ON_COPY, DERIVE_HASH_XOR_EQ]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Derive {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
         if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, _) = item.kind {
             let ty = cx.tcx.type_of(cx.tcx.hir().local_def_id(item.hir_id));
             let is_automatically_derived = is_automatically_derived(&*item.attrs);
@@ -130,7 +130,7 @@ fn check_hash_peq<'a, 'tcx>(
 }
 
 /// Implementation of the `EXPL_IMPL_CLONE_ON_COPY` lint.
-fn check_copy_clone<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, item: &Item, trait_ref: &TraitRef, ty: Ty<'tcx>) {
+fn check_copy_clone<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, item: &Item<'_>, trait_ref: &TraitRef, ty: Ty<'tcx>) {
     if match_path(&trait_ref.path, &paths::CLONE_TRAIT) {
         if !is_copy(cx, ty) {
             return;
index 8f8d8ad96bbee14a9eb714cc0d05c23fd40efa9e..327c18e855d985fe867071e877e0e435bcc99b36 100644 (file)
@@ -146,11 +146,11 @@ pub fn new(valid_idents: FxHashSet<String>) -> Self {
 impl_lint_pass!(DocMarkdown => [DOC_MARKDOWN, MISSING_SAFETY_DOC, MISSING_ERRORS_DOC, NEEDLESS_DOCTEST_MAIN]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DocMarkdown {
-    fn check_crate(&mut self, cx: &LateContext<'a, 'tcx>, krate: &'tcx hir::Crate) {
+    fn check_crate(&mut self, cx: &LateContext<'a, 'tcx>, krate: &'tcx hir::Crate<'_>) {
         check_attrs(cx, &self.valid_idents, &krate.attrs);
     }
 
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item<'_>) {
         let headers = check_attrs(cx, &self.valid_idents, &item.attrs);
         match item.kind {
             hir::ItemKind::Fn(ref sig, ..) => {
@@ -163,20 +163,20 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
         }
     }
 
-    fn check_item_post(&mut self, _cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
+    fn check_item_post(&mut self, _cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item<'_>) {
         if let hir::ItemKind::Impl(..) = item.kind {
             self.in_trait_impl = false;
         }
     }
 
-    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::TraitItem<'_>) {
         let headers = check_attrs(cx, &self.valid_idents, &item.attrs);
         if let hir::TraitItemKind::Method(ref sig, ..) = item.kind {
             lint_for_missing_headers(cx, item.hir_id, item.span, sig, headers);
         }
     }
 
-    fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::ImplItem) {
+    fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::ImplItem<'_>) {
         let headers = check_attrs(cx, &self.valid_idents, &item.attrs);
         if self.in_trait_impl {
             return;
index 1d7f18befc018865921b1b7187a4909ddeac423a..24ab0d5957195287591af9d7e1e590711b2f2208 100644 (file)
@@ -27,7 +27,7 @@
 declare_lint_pass!(EmptyEnum => [EMPTY_ENUM]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EmptyEnum {
-    fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &Item) {
+    fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &Item<'_>) {
         let did = cx.tcx.hir().local_def_id(item.hir_id);
         if let ItemKind::Enum(..) = item.kind {
             let ty = cx.tcx.type_of(did);
index c4b368a6e2e8054ba32292d6ec373696142f2c8e..1fa694b3ae1e1c72388d159250af12968428b42b 100644 (file)
@@ -41,7 +41,7 @@
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnportableVariant {
     #[allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap, clippy::cast_sign_loss)]
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
         if cx.tcx.data_layout.pointer_size.bits() != 64 {
             return;
         }
index 549518d3cdeefec845306676638fdfa1f00adf37..e7a5e520b9170b5b2659a7d25fde4d950250a397 100644 (file)
@@ -29,7 +29,7 @@
 declare_lint_pass!(EnumGlobUse => [ENUM_GLOB_USE]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EnumGlobUse {
-    fn check_mod(&mut self, cx: &LateContext<'a, 'tcx>, m: &'tcx Mod, _: Span, _: HirId) {
+    fn check_mod(&mut self, cx: &LateContext<'a, 'tcx>, m: &'tcx Mod<'_>, _: Span, _: HirId) {
         let map = cx.tcx.hir();
         // only check top level `use` statements
         for item in &m.item_ids {
@@ -38,7 +38,7 @@ fn check_mod(&mut self, cx: &LateContext<'a, 'tcx>, m: &'tcx Mod, _: Span, _: Hi
     }
 }
 
-fn lint_item(cx: &LateContext<'_, '_>, item: &Item) {
+fn lint_item(cx: &LateContext<'_, '_>, item: &Item<'_>) {
     if item.vis.node.is_pub() {
         return; // re-exports are fine
     }
index 8554b879b86d3d622ac67a47d4aefbccc8c5d7e1..c44f2c696580c311700f3a7bd4a51c0bde8b1187 100644 (file)
@@ -56,7 +56,7 @@ fn check_fn(
         cx: &LateContext<'a, 'tcx>,
         _: visit::FnKind<'tcx>,
         _: &'tcx FnDecl,
-        body: &'tcx Body,
+        body: &'tcx Body<'_>,
         _: Span,
         hir_id: HirId,
     ) {
index 329e5cd1f45d04b197ac2b45c170ca1d3a4e8914..e1343d9ada6db2c4d54e401ba91e9bbd3c882f1d 100644 (file)
@@ -32,7 +32,7 @@
 declare_lint_pass!(FallibleImplFrom => [FALLIBLE_IMPL_FROM]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for FallibleImplFrom {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item<'_>) {
         // check for `impl From<???> for ..`
         let impl_def_id = cx.tcx.hir().local_def_id(item.hir_id);
         if_chain! {
index 19e5aace557a792341f09efaceb7b4cde95ebcb6..6191c41bb4491ecc8277ee5bcc70eaedf4ded6c3 100644 (file)
@@ -187,7 +187,7 @@ fn check_fn(
         cx: &LateContext<'a, 'tcx>,
         kind: intravisit::FnKind<'tcx>,
         decl: &'tcx hir::FnDecl,
-        body: &'tcx hir::Body,
+        body: &'tcx hir::Body<'_>,
         span: Span,
         hir_id: hir::HirId,
     ) {
@@ -227,7 +227,7 @@ fn check_fn(
         self.check_line_number(cx, span, body);
     }
 
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item<'_>) {
         let attr = must_use_attr(&item.attrs);
         if let hir::ItemKind::Fn(ref sig, ref _generics, ref body_id) = item.kind {
             if let Some(attr) = attr {
@@ -249,7 +249,7 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
         }
     }
 
-    fn check_impl_item(&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 let hir::ImplItemKind::Method(ref sig, ref body_id) = item.kind {
             let attr = must_use_attr(&item.attrs);
             if let Some(attr) = attr {
@@ -272,7 +272,7 @@ fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::ImplI
         }
     }
 
-    fn check_trait_item(&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::TraitItemKind::Method(ref sig, ref eid) = item.kind {
             // don't lint extern functions decls, it's not their fault
             if sig.header.abi == Abi::Rust {
@@ -317,7 +317,7 @@ fn check_arg_number(self, cx: &LateContext<'_, '_>, decl: &hir::FnDecl, fn_span:
         }
     }
 
-    fn check_line_number(self, cx: &LateContext<'_, '_>, span: Span, body: &'tcx hir::Body) {
+    fn check_line_number(self, cx: &LateContext<'_, '_>, span: Span, body: &'tcx hir::Body<'_>) {
         if in_external_macro(cx.sess(), span) {
             return;
         }
@@ -375,7 +375,7 @@ fn check_raw_ptr(
         cx: &LateContext<'a, 'tcx>,
         unsafety: hir::Unsafety,
         decl: &'tcx hir::FnDecl,
-        body: &'tcx hir::Body,
+        body: &'tcx hir::Body<'_>,
         hir_id: hir::HirId,
     ) {
         let expr = &body.value;
@@ -439,7 +439,7 @@ fn check_needless_must_use(
 fn check_must_use_candidate<'a, 'tcx>(
     cx: &LateContext<'a, 'tcx>,
     decl: &'tcx hir::FnDecl,
-    body: &'tcx hir::Body,
+    body: &'tcx hir::Body<'_>,
     item_span: Span,
     item_id: hir::HirId,
     fn_span: Span,
@@ -521,7 +521,7 @@ fn is_must_use_ty<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool {
     }
 }
 
-fn has_mutable_arg(cx: &LateContext<'_, '_>, body: &hir::Body) -> bool {
+fn has_mutable_arg(cx: &LateContext<'_, '_>, body: &hir::Body<'_>) -> bool {
     let mut tys = FxHashSet::default();
     body.params.iter().any(|param| is_mutable_pat(cx, &param.pat, &mut tys))
 }
@@ -686,7 +686,7 @@ fn is_mutated_static(cx: &LateContext<'_, '_>, e: &hir::Expr) -> bool {
     }
 }
 
-fn mutates_static<'a, 'tcx>(cx: &'a LateContext<'a, 'tcx>, body: &'tcx hir::Body) -> bool {
+fn mutates_static<'a, 'tcx>(cx: &'a LateContext<'a, 'tcx>, body: &'tcx hir::Body<'_>) -> bool {
     let mut v = StaticMutVisitor {
         cx,
         mutates_static: false,
index b926526e7758c7e718822573c4ca4c0748ece02e..a09856dedaeac19e043823d6893209e8cdf63488 100644 (file)
@@ -130,7 +130,7 @@ fn check_fn(
         cx: &LateContext<'a, 'tcx>,
         _: FnKind<'tcx>,
         _: &'tcx FnDecl,
-        body: &'tcx Body,
+        body: &'tcx Body<'_>,
         span: Span,
         _: HirId,
     ) {
index 91d0f491510e021ee4062766e13c8413ca6bf185..860c4e84eb366d5b86a56f3b10ac39df9f1a9c86 100644 (file)
@@ -49,7 +49,7 @@ pub struct MultipleInherentImpl {
 impl_lint_pass!(MultipleInherentImpl => [MULTIPLE_INHERENT_IMPL]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MultipleInherentImpl {
-    fn check_item(&mut self, _: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, _: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
         if let ItemKind::Impl(_, _, _, ref generics, None, _, _) = item.kind {
             // Remember for each inherent implementation encoutered its span and generics
             // but filter out implementations that have generic params (type or lifetime)
@@ -60,7 +60,7 @@ fn check_item(&mut self, _: &LateContext<'a, 'tcx>, item: &'tcx Item) {
         }
     }
 
-    fn check_crate_post(&mut self, cx: &LateContext<'a, 'tcx>, krate: &'tcx Crate) {
+    fn check_crate_post(&mut self, cx: &LateContext<'a, 'tcx>, krate: &'tcx Crate<'_>) {
         if let Some(item) = krate.items.values().nth(0) {
             // Retrieve all inherent implementations from the crate, grouped by type
             for impls in cx
index d1ed6f3bbc41038e4bf9207783aae1da5608ae68..150a9ea9c96735fc646d0e4faac928334007c65c 100644 (file)
@@ -94,7 +94,7 @@
 declare_lint_pass!(InherentToString => [INHERENT_TO_STRING, INHERENT_TO_STRING_SHADOW_DISPLAY]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InherentToString {
-    fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx ImplItem) {
+    fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx ImplItem<'_>) {
         if impl_item.span.from_expansion() {
             return;
         }
@@ -120,7 +120,7 @@ fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx ImplI
     }
 }
 
-fn show_lint(cx: &LateContext<'_, '_>, item: &ImplItem) {
+fn show_lint(cx: &LateContext<'_, '_>, item: &ImplItem<'_>) {
     let display_trait_id =
         get_trait_def_id(cx, &["core", "fmt", "Display"]).expect("Failed to get trait ID of `Display`!");
 
index 0e8531e6d772b39e3a6d090d95fbedc57f703dcc..c87fc2824de2b2ae61eca56e5ad459f70bde3f48 100644 (file)
@@ -32,7 +32,7 @@
 declare_lint_pass!(InlineFnWithoutBody => [INLINE_FN_WITHOUT_BODY]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InlineFnWithoutBody {
-    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem<'_>) {
         if let TraitItemKind::Method(_, TraitMethod::Required(_)) = item.kind {
             check_attrs(cx, item.ident.name, &item.attrs);
         }
index cfc4857d62784a4598f7cdf1cb1144ba000776a5..fe3bcf0ab826af6b466115c54ea27c9da0612ca3 100644 (file)
@@ -47,7 +47,7 @@ pub fn new(maximum_size_difference_allowed: u64) -> Self {
 impl_lint_pass!(LargeEnumVariant => [LARGE_ENUM_VARIANT]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LargeEnumVariant {
-    fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &Item) {
+    fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &Item<'_>) {
         let did = cx.tcx.hir().local_def_id(item.hir_id);
         if let ItemKind::Enum(ref def, _) = item.kind {
             let ty = cx.tcx.type_of(did);
index 3081fc856c50668cb39cdf2d5b15fd517c93e1e8..ea2891f59ccc4208c5a2a24265ffbf50d9c6b4c0 100644 (file)
@@ -73,7 +73,7 @@
 declare_lint_pass!(LenZero => [LEN_ZERO, LEN_WITHOUT_IS_EMPTY]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LenZero {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
         if item.span.from_expansion() {
             return;
         }
@@ -116,7 +116,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
     }
 }
 
-fn check_trait_items(cx: &LateContext<'_, '_>, visited_trait: &Item, trait_items: &[TraitItemRef]) {
+fn check_trait_items(cx: &LateContext<'_, '_>, visited_trait: &Item<'_>, trait_items: &[TraitItemRef]) {
     fn is_named_self(cx: &LateContext<'_, '_>, item: &TraitItemRef, name: &str) -> bool {
         item.ident.name.as_str() == name
             && if let AssocItemKind::Method { has_self } = item.kind {
@@ -167,7 +167,7 @@ fn fill_trait_set(traitt: DefId, set: &mut FxHashSet<DefId>, cx: &LateContext<'_
     }
 }
 
-fn check_impl_items(cx: &LateContext<'_, '_>, item: &Item, impl_items: &[ImplItemRef]) {
+fn check_impl_items(cx: &LateContext<'_, '_>, item: &Item<'_>, impl_items: &[ImplItemRef]) {
     fn is_named_self(cx: &LateContext<'_, '_>, item: &ImplItemRef, name: &str) -> bool {
         item.ident.name.as_str() == name
             && if let AssocItemKind::Method { has_self } = item.kind {
index 012030472991216cda4160d2a5d046f28638badc..5edf1cb839f8e1d5e87d79e8a5b210062e886b3b 100644 (file)
 declare_lint_pass!(Lifetimes => [NEEDLESS_LIFETIMES, EXTRA_UNUSED_LIFETIMES]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Lifetimes {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
         if let ItemKind::Fn(ref sig, ref generics, id) = item.kind {
             check_fn_inner(cx, &sig.decl, Some(id), generics, item.span, true);
         }
     }
 
-    fn check_impl_item(&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, id) = item.kind {
             let report_extra_lifetimes = trait_ref_of_method(cx, item.hir_id).is_none();
             check_fn_inner(
@@ -91,7 +91,7 @@ fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem)
         }
     }
 
-    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem<'_>) {
         if let TraitItemKind::Method(ref sig, ref body) = item.kind {
             let body = match *body {
                 TraitMethod::Required(_) => None,
index fa27890eafb66a681006c3828fd8c06a5b0c2cf3..54840702cb073369b64e484326017cfad425160e 100644 (file)
@@ -35,7 +35,7 @@ pub struct MainRecursion {
 impl_lint_pass!(MainRecursion => [MAIN_RECURSION]);
 
 impl LateLintPass<'_, '_> for MainRecursion {
-    fn check_crate(&mut self, _: &LateContext<'_, '_>, krate: &Crate) {
+    fn check_crate(&mut self, _: &LateContext<'_, '_>, krate: &Crate<'_>) {
         self.has_no_std_attr = krate.attrs.iter().any(|attr| {
             if let AttrKind::Normal(ref attr) = attr.kind {
                 attr.path == sym::no_std
index 0b6be920d9940cf3172de2145ad8cbf4bf8c0eab..8a4d08ccb984bbf6a7a67eb3e7b3efee746bce21 100644 (file)
@@ -1256,7 +1256,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
         }
     }
 
-    fn check_impl_item(&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 in_external_macro(cx.sess(), impl_item.span) {
             return;
         }
index 5dc5e4023e90df22d1425aa37c92e6c31878a2bc..9c4769fa67556963e6ca32fedee2d836084f7af3 100644 (file)
@@ -238,7 +238,7 @@ fn check_fn(
         cx: &LateContext<'a, 'tcx>,
         k: FnKind<'tcx>,
         decl: &'tcx FnDecl,
-        body: &'tcx Body,
+        body: &'tcx Body<'_>,
         _: Span,
         _: HirId,
     ) {
index be7df2670a9ed3c4ff7fd8550a99cfc3d9a5c1fd..568b9e90cced75bdfedd2ff92eefbc2f0c2c75e3 100644 (file)
@@ -77,7 +77,7 @@ fn check_fn(
         cx: &LateContext<'_, '_>,
         kind: FnKind<'_>,
         _: &FnDecl,
-        _: &Body,
+        _: &Body<'_>,
         span: Span,
         hir_id: HirId,
     ) {
index a61034ce0d2a70a961fc676f88694077679ffc1f..f1a11c5030c2704ab4b1b3ea2fea76d35e7a9357 100644 (file)
@@ -125,11 +125,11 @@ fn exit_lint_attrs(&mut self, _: &LateContext<'a, 'tcx>, _: &'tcx [ast::Attribut
         self.doc_hidden_stack.pop().expect("empty doc_hidden_stack");
     }
 
-    fn check_crate(&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(&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.kind {
             hir::ItemKind::Const(..) => "a constant",
             hir::ItemKind::Enum(..) => "an enum",
@@ -162,7 +162,7 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
         self.check_missing_docs_attrs(cx, &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<'a, 'tcx>, trait_item: &'tcx hir::TraitItem<'_>) {
         let desc = match trait_item.kind {
             hir::TraitItemKind::Const(..) => "an associated constant",
             hir::TraitItemKind::Method(..) => "a trait method",
@@ -172,7 +172,7 @@ fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, trait_item: &'tcx hir
         self.check_missing_docs_attrs(cx, &trait_item.attrs, trait_item.span, desc);
     }
 
-    fn check_impl_item(&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.hir().local_def_id(impl_item.hir_id);
         match cx.tcx.associated_item(def_id).container {
@@ -193,13 +193,13 @@ fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx hir::
         self.check_missing_docs_attrs(cx, &impl_item.attrs, impl_item.span, desc);
     }
 
-    fn check_struct_field(&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(&mut self, cx: &LateContext<'a, 'tcx>, v: &'tcx hir::Variant) {
+    fn check_variant(&mut self, cx: &LateContext<'a, 'tcx>, v: &'tcx hir::Variant<'_>) {
         self.check_missing_docs_attrs(cx, &v.attrs, v.span, "a variant");
     }
 }
index 9eee8bc1081a366f733bc31c35136933e5b9bc48..00ccd853cc35200e779fd46efe46b71aeb5e9432 100644 (file)
@@ -81,7 +81,7 @@ fn is_executable(cx: &LateContext<'_, '_>) -> bool {
 declare_lint_pass!(MissingInline => [MISSING_INLINE_IN_PUBLIC_ITEMS]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingInline {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item<'_>) {
         if lint::in_external_macro(cx.sess(), it.span) || is_executable(cx) {
             return;
         }
@@ -130,7 +130,7 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx hir::Item) {
         };
     }
 
-    fn check_impl_item(&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<'_>) {
         use rustc::ty::{ImplContainer, TraitContainer};
         if lint::in_external_macro(cx.sess(), impl_item.span) || is_executable(cx) {
             return;
index 70d459db0c62af512056aec97a446f247c4b7a56..6e18501480b6043bc5d0ebaea57fd36446db195f 100644 (file)
@@ -108,14 +108,14 @@ fn check_pat(&mut self, cx: &LateContext<'a, 'tcx>, pat: &'tcx Pat) {
         }
     }
 
-    fn check_item(&mut self, _: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, _: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
         if item.attrs.iter().any(|a| a.check_name(sym!(automatically_derived))) {
             debug_assert!(self.derived_item.is_none());
             self.derived_item = Some(item.hir_id);
         }
     }
 
-    fn check_item_post(&mut self, _: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item_post(&mut self, _: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
         if let Some(id) = self.derived_item {
             if item.hir_id == id {
                 self.derived_item = None;
index f532f6fbec88abf6f27f983673d6fa05eb7f0876..8f786c5a121a3df11802f53022575ac7f10cf28b 100644 (file)
@@ -72,7 +72,7 @@ fn check_fn(
         cx: &LateContext<'a, 'tcx>,
         kind: FnKind<'tcx>,
         decl: &'tcx FnDecl,
-        body: &'tcx Body,
+        body: &'tcx Body<'_>,
         span: Span,
         hir_id: HirId,
     ) {
index 7e7d31b2b293f3483cb98696a442118619768272..bbe76fae51eed72e591eae2dc31743835256e689 100644 (file)
@@ -93,7 +93,7 @@ pub struct NewWithoutDefault {
 impl_lint_pass!(NewWithoutDefault => [NEW_WITHOUT_DEFAULT]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item<'_>) {
         if let hir::ItemKind::Impl(_, _, _, _, None, _, ref items) = item.kind {
             for assoc_item in items {
                 if let hir::AssocItemKind::Method { has_self: false } = assoc_item.kind {
index d8469303e7abf49e02ddcf1ad8bd423a5f359add..40f1c2917165833ede7a53bda4b1696be040123b 100644 (file)
@@ -143,14 +143,14 @@ fn verify_ty_bound<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'tcx>, source: S
 declare_lint_pass!(NonCopyConst => [DECLARE_INTERIOR_MUTABLE_CONST, BORROW_INTERIOR_MUTABLE_CONST]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonCopyConst {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, it: &'tcx Item<'_>) {
         if let ItemKind::Const(hir_ty, ..) = &it.kind {
             let ty = hir_ty_to_ty(cx.tcx, hir_ty);
             verify_ty_bound(cx, ty, Source::Item { item: it.span });
         }
     }
 
-    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, trait_item: &'tcx TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, trait_item: &'tcx TraitItem<'_>) {
         if let TraitItemKind::Const(hir_ty, ..) = &trait_item.kind {
             let ty = hir_ty_to_ty(cx.tcx, hir_ty);
             verify_ty_bound(
@@ -164,7 +164,7 @@ fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, trait_item: &'tcx Tra
         }
     }
 
-    fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx ImplItem) {
+    fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx ImplItem<'_>) {
         if let ImplItemKind::Const(hir_ty, ..) = &impl_item.kind {
             let item_hir_id = cx.tcx.hir().get_parent_node(impl_item.hir_id);
             let item = cx.tcx.hir().expect_item(item_hir_id);
index a78c27fb785b1c1fd5c2890f18652a8ecdaf39b1..6e1c7561a3a2ad729a9a0cbe38a53d6285ad7119 100644 (file)
@@ -32,7 +32,7 @@
 declare_lint_pass!(PartialEqNeImpl => [PARTIALEQ_NE_IMPL]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PartialEqNeImpl {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
         if_chain! {
             if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, ref impl_items) = item.kind;
             if !is_automatically_derived(&*item.attrs);
index c0a7d37f1695cd097d04e95a7bfda955e8a20874..c741c43bc99a212421edb120592d344dae622f7c 100644 (file)
 declare_lint_pass!(Ptr => [PTR_ARG, CMP_NULL, MUT_FROM_REF]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Ptr {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
         if let ItemKind::Fn(ref sig, _, body_id) = item.kind {
             check_fn(cx, &sig.decl, item.hir_id, Some(body_id));
         }
     }
 
-    fn check_impl_item(&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, body_id) = item.kind {
             let parent_item = cx.tcx.hir().get_parent_item(item.hir_id);
             if let Some(Node::Item(it)) = cx.tcx.hir().find(parent_item) {
@@ -119,7 +119,7 @@ fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem)
         }
     }
 
-    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem<'_>) {
         if let TraitItemKind::Method(ref sig, ref trait_method) = item.kind {
             let body_id = if let TraitMethod::Provided(b) = *trait_method {
                 Some(b)
index a258e31e512521cb45ee6cf03cf8ead7b585f160..583ebfe5c3e812a4e74d5f4bbfd1274576b99f77 100644 (file)
@@ -76,7 +76,7 @@ fn check_fn(
         cx: &LateContext<'a, 'tcx>,
         _: FnKind<'tcx>,
         _: &'tcx FnDecl,
-        body: &'tcx Body,
+        body: &'tcx Body<'_>,
         _: Span,
         _: HirId,
     ) {
index 6f7d60b0dd5772cfa91d449a3716da48d0093f30..e06ebe539e7b7bdf40c6222bf41401c9bcd609f9 100644 (file)
@@ -76,7 +76,7 @@ pub struct Regex {
 impl_lint_pass!(Regex => [INVALID_REGEX, REGEX_MACRO, TRIVIAL_REGEX]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Regex {
-    fn check_crate(&mut self, _: &LateContext<'a, 'tcx>, _: &'tcx Crate) {
+    fn check_crate(&mut self, _: &LateContext<'a, 'tcx>, _: &'tcx Crate<'_>) {
         self.spans.clear();
     }
 
index 5fb517abc31136e9be721ff69d6f9774e51d546a..aabdb8c730000b6f21bf82b3ea5dc16f8d55dba7 100644 (file)
@@ -22,7 +22,7 @@
 declare_lint_pass!(SerdeAPI => [SERDE_API_MISUSE]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for SerdeAPI {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
         if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, ref items) = item.kind {
             let did = trait_ref.path.res.def_id();
             if let Some(visit_did) = get_trait_def_id(cx, &paths::SERDE_DE_VISITOR) {
index 5d2767d849dd5d6f643a0caf0f48a9a8e23a379f..cfb1900bb3cfc24e79abca46621a63e07076f327 100644 (file)
@@ -89,7 +89,7 @@ fn check_fn(
         cx: &LateContext<'a, 'tcx>,
         _: FnKind<'tcx>,
         decl: &'tcx FnDecl,
-        body: &'tcx Body,
+        body: &'tcx Body<'_>,
         _: Span,
         _: HirId,
     ) {
@@ -100,7 +100,7 @@ fn check_fn(
     }
 }
 
-fn check_fn<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, decl: &'tcx FnDecl, body: &'tcx Body) {
+fn check_fn<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, decl: &'tcx FnDecl, body: &'tcx Body<'_>) {
     let mut bindings = Vec::new();
     for arg in iter_input_pats(decl, body) {
         if let PatKind::Binding(.., ident, _) = arg.pat.kind {
index 77ef436afb10c31d7b8eb0a29d7c1103c1aa4203..cb445b89db45465f597a0e910fcb40205bd788e7 100644 (file)
@@ -128,7 +128,7 @@ fn check_poly_fn(&mut self, cx: &LateContext<'_, 'tcx>, hir_id: HirId, decl: &Fn
 impl_lint_pass!(TriviallyCopyPassByRef => [TRIVIALLY_COPY_PASS_BY_REF]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TriviallyCopyPassByRef {
-    fn check_trait_item(&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 item.span.from_expansion() {
             return;
         }
@@ -143,7 +143,7 @@ fn check_fn(
         cx: &LateContext<'a, 'tcx>,
         kind: FnKind<'tcx>,
         decl: &'tcx FnDecl,
-        _body: &'tcx Body,
+        _body: &'tcx Body<'_>,
         span: Span,
         hir_id: HirId,
     ) {
index 478c8fe686dcafb92cfb1be09c3583ad17037446..143262b21cfc1a2ef7d82479474f6002d16d6ea8 100644 (file)
 declare_lint_pass!(Types => [BOX_VEC, VEC_BOX, OPTION_OPTION, LINKEDLIST, BORROWED_BOX]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Types {
-    fn check_fn(&mut self, cx: &LateContext<'_, '_>, _: FnKind<'_>, decl: &FnDecl, _: &Body, _: Span, id: HirId) {
+    fn check_fn(&mut self, cx: &LateContext<'_, '_>, _: FnKind<'_>, decl: &FnDecl, _: &Body<'_>, _: Span, id: HirId) {
         // Skip trait implementations; see issue #605.
         if let Some(hir::Node::Item(item)) = cx.tcx.hir().find(cx.tcx.hir().get_parent_item(id)) {
             if let ItemKind::Impl(_, _, _, _, Some(..), _, _) = item.kind {
@@ -181,11 +181,11 @@ fn check_fn(&mut self, cx: &LateContext<'_, '_>, _: FnKind<'_>, decl: &FnDecl, _
         check_fn_decl(cx, decl);
     }
 
-    fn check_struct_field(&mut self, cx: &LateContext<'_, '_>, field: &hir::StructField) {
+    fn check_struct_field(&mut self, cx: &LateContext<'_, '_>, field: &hir::StructField<'_>) {
         check_ty(cx, &field.ty, false);
     }
 
-    fn check_trait_item(&mut self, cx: &LateContext<'_, '_>, item: &TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext<'_, '_>, item: &TraitItem<'_>) {
         match item.kind {
             TraitItemKind::Const(ref ty, _) | TraitItemKind::Type(_, Some(ref ty)) => check_ty(cx, ty, false),
             TraitItemKind::Method(ref sig, _) => check_fn_decl(cx, &sig.decl),
@@ -1395,19 +1395,19 @@ fn check_fn(
         cx: &LateContext<'a, 'tcx>,
         _: FnKind<'tcx>,
         decl: &'tcx FnDecl,
-        _: &'tcx Body,
+        _: &'tcx Body<'_>,
         _: Span,
         _: HirId,
     ) {
         self.check_fndecl(cx, decl);
     }
 
-    fn check_struct_field(&mut self, cx: &LateContext<'a, 'tcx>, field: &'tcx hir::StructField) {
+    fn check_struct_field(&mut self, cx: &LateContext<'a, 'tcx>, field: &'tcx hir::StructField<'_>) {
         // enum variants are also struct fields now
         self.check_type(cx, &field.ty);
     }
 
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
         match item.kind {
             ItemKind::Static(ref ty, _, _) | ItemKind::Const(ref ty, _) => self.check_type(cx, ty),
             // functions, enums, structs, impls and traits are covered
@@ -1415,7 +1415,7 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
         }
     }
 
-    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
+    fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem<'_>) {
         match item.kind {
             TraitItemKind::Const(ref ty, _) | TraitItemKind::Type(_, Some(ref ty)) => self.check_type(cx, ty),
             TraitItemKind::Method(FnSig { ref decl, .. }, TraitMethod::Required(_)) => self.check_fndecl(cx, decl),
@@ -1424,7 +1424,7 @@ fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem
         }
     }
 
-    fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
+    fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem<'_>) {
         match item.kind {
             ImplItemKind::Const(ref ty, _) | ImplItemKind::TyAlias(ref ty) => self.check_type(cx, ty),
             // methods are covered by check_fn
@@ -2036,7 +2036,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ImplicitHasher {
     #[allow(clippy::cast_possible_truncation, clippy::too_many_lines)]
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
         use syntax_pos::BytePos;
 
         fn suggestion<'a, 'tcx>(
@@ -2291,7 +2291,7 @@ fn new(cx: &'a LateContext<'a, 'tcx>, target: &'b ImplicitHasherType<'tcx>) -> S
 }
 
 impl<'a, 'b, 'tcx> Visitor<'tcx> for ImplicitHasherConstructorVisitor<'a, 'b, 'tcx> {
-    fn visit_body(&mut self, body: &'tcx Body) {
+    fn visit_body(&mut self, body: &'tcx Body<'_>) {
         let prev_body = self.body;
         self.body = self.cx.tcx.body_tables(body.id());
         walk_body(self, body);
index bbf6faa2c7e641194c32386098fb1e5b9a775d9e..e9f655287e6872c2b5713dd39258df30e56e1fc9 100644 (file)
@@ -40,7 +40,7 @@
 declare_lint_pass!(UnusedSelf => [UNUSED_SELF]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedSelf {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &Item<'_>) {
         if item.span.from_expansion() {
             return;
         }
index 736150a86b640523d61d7ac3294fcc6b05e1bd76..555a157c2751319b13f59d5667394cd5145749d2 100644 (file)
@@ -192,7 +192,7 @@ fn check_fn(
         cx: &LateContext<'a, 'tcx>,
         kind: FnKind<'tcx>,
         decl: &'tcx FnDecl,
-        body: &'tcx Body,
+        body: &'tcx Body<'_>,
         span: Span,
         fn_id: HirId,
     ) {
index 4b9945d20b5c0a9405eb328edae5c95fa2891878..bd1267d549a0907195644742a0fbe52db42601f6 100644 (file)
@@ -115,7 +115,7 @@ fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
 fn check_trait_method_impl_decl<'a, 'tcx>(
     cx: &'a LateContext<'a, 'tcx>,
     item_type: Ty<'tcx>,
-    impl_item: &ImplItem,
+    impl_item: &ImplItem<'_>,
     impl_decl: &'tcx FnDecl,
     impl_trait_ref: &ty::TraitRef<'_>,
 ) {
@@ -165,7 +165,7 @@ fn check_trait_method_impl_decl<'a, 'tcx>(
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UseSelf {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
         if in_external_macro(cx.sess(), item.span) {
             return;
         }
@@ -257,7 +257,7 @@ fn visit_path(&mut self, path: &'tcx Path, _id: HirId) {
         walk_path(self, path);
     }
 
-    fn visit_item(&mut self, item: &'tcx Item) {
+    fn visit_item(&mut self, item: &'tcx Item<'_>) {
         match item.kind {
             ItemKind::Use(..)
             | ItemKind::Static(..)
index a7b049db167a1645946931b133e352881206907e..4eb8bceba148daecab9870d1a32e23c7473f9920 100644 (file)
@@ -64,7 +64,7 @@ fn done() {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Author {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item<'_>) {
         if !has_attr(cx.sess(), &item.attrs) {
             return;
         }
@@ -73,7 +73,7 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
         done();
     }
 
-    fn check_impl_item(&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(cx.sess(), &item.attrs) {
             return;
         }
@@ -82,7 +82,7 @@ fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::ImplI
         done();
     }
 
-    fn check_trait_item(&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(cx.sess(), &item.attrs) {
             return;
         }
@@ -91,7 +91,7 @@ fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Trai
         done();
     }
 
-    fn check_variant(&mut self, cx: &LateContext<'a, 'tcx>, var: &'tcx hir::Variant) {
+    fn check_variant(&mut self, cx: &LateContext<'a, 'tcx>, var: &'tcx hir::Variant<'_>) {
         if !has_attr(cx.sess(), &var.attrs) {
             return;
         }
@@ -100,7 +100,7 @@ fn check_variant(&mut self, cx: &LateContext<'a, 'tcx>, var: &'tcx hir::Variant)
         done();
     }
 
-    fn check_struct_field(&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(cx.sess(), &field.attrs) {
             return;
         }
@@ -136,7 +136,7 @@ fn check_stmt(&mut self, cx: &LateContext<'a, 'tcx>, stmt: &'tcx hir::Stmt) {
         done();
     }
 
-    fn check_foreign_item(&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(cx.sess(), &item.attrs) {
             return;
         }
index 6511999ec72e7b583a1df2135e878ce7cc2a415a..bd8685cc487f0d67306b519b8afd080f73628f9d 100644 (file)
 declare_lint_pass!(DeepCodeInspector => [DEEP_CODE_INSPECTION]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DeepCodeInspector {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item<'_>) {
         if !has_attr(cx.sess(), &item.attrs) {
             return;
         }
         print_item(cx, item);
     }
 
-    fn check_impl_item(&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(cx.sess(), &item.attrs) {
             return;
         }
@@ -326,7 +326,7 @@ fn print_expr(cx: &LateContext<'_, '_>, expr: &hir::Expr, indent: usize) {
     }
 }
 
-fn print_item(cx: &LateContext<'_, '_>, item: &hir::Item) {
+fn print_item(cx: &LateContext<'_, '_>, item: &hir::Item<'_>) {
     let did = cx.tcx.hir().local_def_id(item.hir_id);
     println!("item `{}`", item.ident.name);
     match item.vis.node {
index e307cc3baf27f8b18960dad0298a007e3787f2ff..a309dc8b8e29422306e552ac45dd59d4e70896e7 100644 (file)
@@ -165,7 +165,7 @@ pub struct LintWithoutLintPass {
 impl_lint_pass!(LintWithoutLintPass => [LINT_WITHOUT_LINT_PASS]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LintWithoutLintPass {
-    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
+    fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) {
         if let hir::ItemKind::Static(ref ty, Mutability::Not, _) = item.kind {
             if is_lint_ref_type(cx, ty) {
                 self.declared_lints.insert(item.ident.name, item.span);
@@ -191,7 +191,7 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
         }
     }
 
-    fn check_crate_post(&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_tool_lint!` macro, the original `lint_span`'s
             // file points to "<rustc macros>".
index c75b61c6718c78be9796a41b4398c9162db633d0..1d3b7ea2c2e9581d41722da83d8961ef600b47a1 100644 (file)
@@ -901,7 +901,7 @@ pub fn is_self_ty(slf: &hir::Ty) -> bool {
     false
 }
 
-pub fn iter_input_pats<'tcx>(decl: &FnDecl, body: &'tcx Body) -> impl Iterator<Item = &'tcx Param> {
+pub fn iter_input_pats<'tcx>(decl: &FnDecl, body: &'tcx Body<'_>) -> impl Iterator<Item = &'tcx Param> {
     (0..decl.inputs.len()).map(move |i| &body.params[i])
 }
 
index 32ec4d6c54869d429e5f6e8eee9403bda820fcd3..dd713296592283ff26001b36ebada75e7a104db9 100644 (file)
@@ -26,7 +26,7 @@ fn extract_clone_suggestions<'a, 'tcx>(
     cx: &LateContext<'a, 'tcx>,
     name: Name,
     replace: &[(&'static str, &'static str)],
-    body: &'tcx Body,
+    body: &'tcx Body<'_>,
 ) -> Option<Vec<(Span, Cow<'static, str>)>> {
     let mut visitor = PtrCloneVisitor {
         cx,