From 4a219685ffd622421e5eb9609dda7a8508a478c6 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Tue, 11 Jun 2019 12:50:17 +0300 Subject: [PATCH] rustdoc: deny(unused_lifetimes). --- src/librustdoc/clean/auto_trait.rs | 2 +- src/librustdoc/clean/mod.rs | 10 +++++----- src/librustdoc/html/render.rs | 2 +- src/librustdoc/lib.rs | 1 + 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs index 60d6c33f81a..7b58312a5ed 100644 --- a/src/librustdoc/clean/auto_trait.rs +++ b/src/librustdoc/clean/auto_trait.rs @@ -341,7 +341,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { .collect() } - fn make_final_bounds<'b, 'c, 'cx>( + fn make_final_bounds( &self, ty_to_bounds: FxHashMap>, ty_to_fn: FxHashMap, Option)>, diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index a717ef20a84..e44c35b55ff 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1298,7 +1298,7 @@ impl Clean for hir::ConstArg { } } -impl<'tcx> Clean for ty::GenericParamDef { +impl Clean for ty::GenericParamDef { fn clean(&self, _cx: &DocContext<'_>) -> Lifetime { Lifetime(self.name.to_string()) } @@ -2039,7 +2039,7 @@ impl<'a, A: Copy> Clean for (&'a hir::FnDecl, A) } } -impl<'a, 'tcx> Clean for (DefId, ty::PolyFnSig<'tcx>) { +impl<'tcx> Clean for (DefId, ty::PolyFnSig<'tcx>) { fn clean(&self, cx: &DocContext<'_>) -> FnDecl { let (did, sig) = *self; let mut names = if cx.tcx.hir().as_local_hir_id(did).is_some() { @@ -2276,7 +2276,7 @@ impl Clean for hir::ImplItem { } } -impl<'tcx> Clean for ty::AssocItem { +impl Clean for ty::AssocItem { fn clean(&self, cx: &DocContext<'_>) -> Item { let inner = match self.kind { ty::AssocKind::Const => { @@ -3174,7 +3174,7 @@ impl Clean for hir::StructField { } } -impl<'tcx> Clean for ty::FieldDef { +impl Clean for ty::FieldDef { fn clean(&self, cx: &DocContext<'_>) -> Item { Item { name: Some(self.ident.name).clean(cx), @@ -3342,7 +3342,7 @@ impl Clean for doctree::Variant { } } -impl<'tcx> Clean for ty::VariantDef { +impl Clean for ty::VariantDef { fn clean(&self, cx: &DocContext<'_>) -> Item { let kind = match self.ctor_kind { CtorKind::Const => VariantKind::CLike, diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 3555e2e7498..36270682059 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1764,7 +1764,7 @@ impl DocFolder for Cache { } } -impl<'a> Cache { +impl Cache { fn generics(&mut self, generics: &clean::Generics) { for param in &generics.params { match param.kind { diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index ffe277ae50b..3b4d65352a3 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -1,5 +1,6 @@ #![deny(rust_2018_idioms)] #![deny(internal)] +#![deny(unused_lifetimes)] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/", html_playground_url = "https://play.rust-lang.org/")]