From ca7de869ea9f7fc9f6f347905c3f715a62e4080e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Mon, 10 Dec 2018 05:37:10 +0100 Subject: [PATCH] Remove lifetime from Resolver --- src/librustc_driver/driver.rs | 10 ++++----- src/librustc_resolve/build_reduced_graph.rs | 10 ++++----- src/librustc_resolve/check_unused.rs | 18 +++++++-------- src/librustc_resolve/error_reporting.rs | 2 +- src/librustc_resolve/lib.rs | 18 +++++++-------- src/librustc_resolve/macros.rs | 10 ++++----- src/librustc_resolve/resolve_imports.rs | 22 +++++++++---------- src/librustdoc/clean/auto_trait.rs | 8 +++---- src/librustdoc/clean/blanket_impl.rs | 8 +++---- src/librustdoc/clean/mod.rs | 2 +- src/librustdoc/core.rs | 6 ++--- .../passes/collect_intra_doc_links.rs | 10 ++++----- src/librustdoc/passes/collect_trait_impls.rs | 10 ++++----- src/librustdoc/passes/mod.rs | 4 ++-- .../passes/private_items_doc_tests.rs | 10 ++++----- src/librustdoc/visit_ast.rs | 10 ++++----- src/librustdoc/visit_lib.rs | 10 ++++----- 17 files changed, 84 insertions(+), 84 deletions(-) diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index f2edcdc1bac35..31dd46eefc888 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -730,9 +730,9 @@ pub struct ExpansionResult { pub hir_forest: hir_map::Forest, } -pub struct InnerExpansionResult<'a, 'b: 'a> { +pub struct InnerExpansionResult<'a> { pub expanded_crate: ast::Crate, - pub resolver: Resolver<'a, 'b>, + pub resolver: Resolver<'a>, pub hir_forest: hir_map::Forest, } @@ -811,7 +811,7 @@ where /// Same as phase_2_configure_and_expand, but doesn't let you keep the resolver /// around -pub fn phase_2_configure_and_expand_inner<'a, 'b: 'a, F>( +pub fn phase_2_configure_and_expand_inner<'a, F>( sess: &'a Session, cstore: &'a CStore, mut krate: ast::Crate, @@ -820,9 +820,9 @@ pub fn phase_2_configure_and_expand_inner<'a, 'b: 'a, F>( addl_plugins: Option>, make_glob_map: MakeGlobMap, resolver_arenas: &'a ResolverArenas<'a>, - crate_loader: &'a mut CrateLoader<'b>, + crate_loader: &'a mut CrateLoader<'a>, after_expand: F, -) -> Result, CompileIncomplete> +) -> Result, CompileIncomplete> where F: FnOnce(&ast::Crate) -> CompileResult, { diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index 191e4e8fe2a83..f082d776969eb 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -83,7 +83,7 @@ impl<'a> ToNameBinding<'a> for (Def, ty::Visibility, Span, Mark, IsMacroExport) } } -impl<'a, 'cl> Resolver<'a, 'cl> { +impl<'a> Resolver<'a> { /// Defines `name` in namespace `ns` of module `parent` to be `def` if it is not yet defined; /// otherwise, reports an error. pub fn define(&mut self, parent: Module<'a>, ident: Ident, ns: Namespace, def: T) @@ -888,13 +888,13 @@ impl<'a, 'cl> Resolver<'a, 'cl> { } } -pub struct BuildReducedGraphVisitor<'a, 'b: 'a, 'c: 'b> { - pub resolver: &'a mut Resolver<'b, 'c>, +pub struct BuildReducedGraphVisitor<'a, 'b: 'a> { + pub resolver: &'a mut Resolver<'b>, pub current_legacy_scope: LegacyScope<'b>, pub expansion: Mark, } -impl<'a, 'b, 'cl> BuildReducedGraphVisitor<'a, 'b, 'cl> { +impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> { fn visit_invoc(&mut self, id: ast::NodeId) -> &'b InvocationData<'b> { let mark = id.placeholder_to_mark(); self.resolver.current_module.unresolved_invocations.borrow_mut().insert(mark); @@ -917,7 +917,7 @@ macro_rules! method { } } -impl<'a, 'b, 'cl> Visitor<'a> for BuildReducedGraphVisitor<'a, 'b, 'cl> { +impl<'a, 'b> Visitor<'a> for BuildReducedGraphVisitor<'a, 'b> { method!(visit_impl_item: ast::ImplItem, ast::ImplItemKind::Macro, walk_impl_item); method!(visit_expr: ast::Expr, ast::ExprKind::Mac, walk_expr); method!(visit_pat: ast::Pat, ast::PatKind::Mac, walk_pat); diff --git a/src/librustc_resolve/check_unused.rs b/src/librustc_resolve/check_unused.rs index 659ca1f5b9f31..5d231d845cfd8 100644 --- a/src/librustc_resolve/check_unused.rs +++ b/src/librustc_resolve/check_unused.rs @@ -31,8 +31,8 @@ use syntax::visit::{self, Visitor}; use syntax_pos::{Span, MultiSpan, DUMMY_SP}; -struct UnusedImportCheckVisitor<'a, 'b: 'a, 'd: 'b> { - resolver: &'a mut Resolver<'b, 'd>, +struct UnusedImportCheckVisitor<'a, 'b: 'a> { + resolver: &'a mut Resolver<'b>, /// All the (so far) unused imports, grouped path list unused_imports: NodeMap>, base_id: ast::NodeId, @@ -40,21 +40,21 @@ struct UnusedImportCheckVisitor<'a, 'b: 'a, 'd: 'b> { } // Deref and DerefMut impls allow treating UnusedImportCheckVisitor as Resolver. -impl<'a, 'b, 'd> Deref for UnusedImportCheckVisitor<'a, 'b, 'd> { - type Target = Resolver<'b, 'd>; +impl<'a, 'b> Deref for UnusedImportCheckVisitor<'a, 'b> { + type Target = Resolver<'b>; - fn deref<'c>(&'c self) -> &'c Resolver<'b, 'd> { + fn deref<'c>(&'c self) -> &'c Resolver<'b> { &*self.resolver } } -impl<'a, 'b, 'd> DerefMut for UnusedImportCheckVisitor<'a, 'b, 'd> { - fn deref_mut<'c>(&'c mut self) -> &'c mut Resolver<'b, 'd> { +impl<'a, 'b> DerefMut for UnusedImportCheckVisitor<'a, 'b> { + fn deref_mut<'c>(&'c mut self) -> &'c mut Resolver<'b> { &mut *self.resolver } } -impl<'a, 'b, 'd> UnusedImportCheckVisitor<'a, 'b, 'd> { +impl<'a, 'b> UnusedImportCheckVisitor<'a, 'b> { // We have information about whether `use` (import) directives are actually // used now. If an import is not used at all, we signal a lint error. fn check_import(&mut self, item_id: ast::NodeId, id: ast::NodeId, span: Span) { @@ -77,7 +77,7 @@ impl<'a, 'b, 'd> UnusedImportCheckVisitor<'a, 'b, 'd> { } } -impl<'a, 'b, 'cl> Visitor<'a> for UnusedImportCheckVisitor<'a, 'b, 'cl> { +impl<'a, 'b> Visitor<'a> for UnusedImportCheckVisitor<'a, 'b> { fn visit_item(&mut self, item: &'a ast::Item) { self.item_span = item.span; diff --git a/src/librustc_resolve/error_reporting.rs b/src/librustc_resolve/error_reporting.rs index 23edaf1243812..5ff012662f91c 100644 --- a/src/librustc_resolve/error_reporting.rs +++ b/src/librustc_resolve/error_reporting.rs @@ -17,7 +17,7 @@ use syntax_pos::Span; use resolve_imports::ImportResolver; use std::cmp::Reverse; -impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> { +impl<'a, 'b:'a> ImportResolver<'a, 'b> { /// Add suggestions for a path that cannot be resolved. pub(crate) fn make_path_suggestion( &mut self, diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index ebd2c87fa4642..3961301f74683 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -742,7 +742,7 @@ impl<'tcx> Visitor<'tcx> for UsePlacementFinder { } /// This thing walks the whole crate in DFS manner, visiting each item, resolving names as it goes. -impl<'a, 'tcx, 'cl> Visitor<'tcx> for Resolver<'a, 'cl> { +impl<'a, 'tcx> Visitor<'tcx> for Resolver<'a> { fn visit_item(&mut self, item: &'tcx Item) { self.resolve_item(item); } @@ -1476,7 +1476,7 @@ pub struct ExternPreludeEntry<'a> { /// The main resolver class. /// /// This is the visitor that walks the whole crate. -pub struct Resolver<'a, 'b: 'a> { +pub struct Resolver<'a> { session: &'a Session, cstore: &'a CStore, @@ -1580,7 +1580,7 @@ pub struct Resolver<'a, 'b: 'a> { arenas: &'a ResolverArenas<'a>, dummy_binding: &'a NameBinding<'a>, - crate_loader: &'a mut CrateLoader<'b>, + crate_loader: &'a mut CrateLoader<'a>, macro_names: FxHashSet, builtin_macros: FxHashMap>, macro_use_prelude: FxHashMap>, @@ -1654,7 +1654,7 @@ impl<'a> ResolverArenas<'a> { } } -impl<'a, 'b: 'a, 'cl: 'b> ty::DefIdTree for &'a Resolver<'b, 'cl> { +impl<'a, 'b: 'a> ty::DefIdTree for &'a Resolver<'b> { fn parent(self, id: DefId) -> Option { match id.krate { LOCAL_CRATE => self.definitions.def_key(id.index).parent, @@ -1665,7 +1665,7 @@ impl<'a, 'b: 'a, 'cl: 'b> ty::DefIdTree for &'a Resolver<'b, 'cl> { /// This interface is used through the AST→HIR step, to embed full paths into the HIR. After that /// the resolver is no longer needed as all the relevant information is inline. -impl<'a, 'cl> hir::lowering::Resolver for Resolver<'a, 'cl> { +impl<'a> hir::lowering::Resolver for Resolver<'a> { fn resolve_hir_path( &mut self, path: &ast::Path, @@ -1711,7 +1711,7 @@ impl<'a, 'cl> hir::lowering::Resolver for Resolver<'a, 'cl> { } } -impl<'a, 'crateloader> Resolver<'a, 'crateloader> { +impl<'a> Resolver<'a> { /// Rustdoc uses this to resolve things in a recoverable way. ResolutionError<'a> /// isn't something that can be returned because it can't be made to live that long, /// and also it's a private type. Fortunately rustdoc doesn't need to know the error, @@ -1800,15 +1800,15 @@ impl<'a, 'crateloader> Resolver<'a, 'crateloader> { } } -impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> { +impl<'a> Resolver<'a> { pub fn new(session: &'a Session, cstore: &'a CStore, krate: &Crate, crate_name: &str, make_glob_map: MakeGlobMap, - crate_loader: &'a mut CrateLoader<'crateloader>, + crate_loader: &'a mut CrateLoader<'a>, arenas: &'a ResolverArenas<'a>) - -> Resolver<'a, 'crateloader> { + -> Resolver<'a> { let root_def_id = DefId::local(CRATE_DEF_INDEX); let root_module_kind = ModuleKind::Def(Def::Mod(root_def_id), keywords::Invalid.name()); let graph_root = arenas.alloc_module(ModuleData { diff --git a/src/librustc_resolve/macros.rs b/src/librustc_resolve/macros.rs index 3f57c74c2c3c5..32f0d84342edd 100644 --- a/src/librustc_resolve/macros.rs +++ b/src/librustc_resolve/macros.rs @@ -121,7 +121,7 @@ fn sub_namespace_match(candidate: Option, requirement: Option base::Resolver for Resolver<'a, 'crateloader> { +impl<'a> base::Resolver for Resolver<'a> { fn next_node_id(&mut self) -> ast::NodeId { self.session.next_node_id() } @@ -139,11 +139,11 @@ impl<'a, 'crateloader: 'a> base::Resolver for Resolver<'a, 'crateloader> { } fn eliminate_crate_var(&mut self, item: P) -> P { - struct EliminateCrateVar<'b, 'a: 'b, 'crateloader: 'a>( - &'b mut Resolver<'a, 'crateloader>, Span + struct EliminateCrateVar<'b, 'a: 'b>( + &'b mut Resolver<'a>, Span ); - impl<'a, 'b, 'crateloader> Folder for EliminateCrateVar<'a, 'b, 'crateloader> { + impl<'a, 'b> Folder for EliminateCrateVar<'a, 'b> { fn fold_path(&mut self, path: ast::Path) -> ast::Path { match self.fold_qpath(None, path) { (None, path) => path, @@ -290,7 +290,7 @@ impl<'a, 'crateloader: 'a> base::Resolver for Resolver<'a, 'crateloader> { } } -impl<'a, 'cl> Resolver<'a, 'cl> { +impl<'a> Resolver<'a> { pub fn dummy_parent_scope(&self) -> ParentScope<'a> { self.invoc_parent_scope(Mark::root(), Vec::new()) } diff --git a/src/librustc_resolve/resolve_imports.rs b/src/librustc_resolve/resolve_imports.rs index 015cd31ac1d76..7b55ee9ce3336 100644 --- a/src/librustc_resolve/resolve_imports.rs +++ b/src/librustc_resolve/resolve_imports.rs @@ -134,7 +134,7 @@ impl<'a> NameResolution<'a> { } } -impl<'a, 'crateloader> Resolver<'a, 'crateloader> { +impl<'a> Resolver<'a> { fn resolution(&self, module: Module<'a>, ident: Ident, ns: Namespace) -> &'a RefCell> { *module.resolutions.borrow_mut().entry((ident.modern(), ns)) @@ -541,7 +541,7 @@ impl<'a, 'crateloader> Resolver<'a, 'crateloader> { // If the resolution becomes a success, define it in the module's glob importers. fn update_resolution(&mut self, module: Module<'a>, ident: Ident, ns: Namespace, f: F) -> T - where F: FnOnce(&mut Resolver<'a, 'crateloader>, &mut NameResolution<'a>) -> T + where F: FnOnce(&mut Resolver<'a>, &mut NameResolution<'a>) -> T { // Ensure that `resolution` isn't borrowed when defining in the module's glob importers, // during which the resolution might end up getting re-defined via a glob cycle. @@ -592,30 +592,30 @@ impl<'a, 'crateloader> Resolver<'a, 'crateloader> { } } -pub struct ImportResolver<'a, 'b: 'a, 'c: 'a + 'b> { - pub resolver: &'a mut Resolver<'b, 'c>, +pub struct ImportResolver<'a, 'b: 'a> { + pub resolver: &'a mut Resolver<'b>, } -impl<'a, 'b: 'a, 'c: 'a + 'b> ::std::ops::Deref for ImportResolver<'a, 'b, 'c> { - type Target = Resolver<'b, 'c>; - fn deref(&self) -> &Resolver<'b, 'c> { +impl<'a, 'b: 'a> ::std::ops::Deref for ImportResolver<'a, 'b> { + type Target = Resolver<'b>; + fn deref(&self) -> &Resolver<'b> { self.resolver } } -impl<'a, 'b: 'a, 'c: 'a + 'b> ::std::ops::DerefMut for ImportResolver<'a, 'b, 'c> { - fn deref_mut(&mut self) -> &mut Resolver<'b, 'c> { +impl<'a, 'b: 'a> ::std::ops::DerefMut for ImportResolver<'a, 'b> { + fn deref_mut(&mut self) -> &mut Resolver<'b> { self.resolver } } -impl<'a, 'b: 'a, 'c: 'a + 'b> ty::DefIdTree for &'a ImportResolver<'a, 'b, 'c> { +impl<'a, 'b: 'a> ty::DefIdTree for &'a ImportResolver<'a, 'b> { fn parent(self, id: DefId) -> Option { self.resolver.parent(id) } } -impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> { +impl<'a, 'b:'a> ImportResolver<'a, 'b> { // Import resolution // // This is a fixed-point algorithm. We resolve imports until our efforts diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs index ac9680b4570c6..2d879fc0f3048 100644 --- a/src/librustdoc/clean/auto_trait.rs +++ b/src/librustdoc/clean/auto_trait.rs @@ -17,13 +17,13 @@ use self::def_ctor::{get_def_from_def_id, get_def_from_node_id}; use super::*; -pub struct AutoTraitFinder<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> { - pub cx: &'a core::DocContext<'a, 'tcx, 'rcx, 'cstore>, +pub struct AutoTraitFinder<'a, 'tcx: 'a, 'rcx: 'a> { + pub cx: &'a core::DocContext<'a, 'tcx, 'rcx>, pub f: auto::AutoTraitFinder<'a, 'tcx>, } -impl<'a, 'tcx, 'rcx, 'cstore> AutoTraitFinder<'a, 'tcx, 'rcx, 'cstore> { - pub fn new(cx: &'a core::DocContext<'a, 'tcx, 'rcx, 'cstore>) -> Self { +impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> { + pub fn new(cx: &'a core::DocContext<'a, 'tcx, 'rcx>) -> Self { let f = auto::AutoTraitFinder::new(&cx.tcx); AutoTraitFinder { cx, f } diff --git a/src/librustdoc/clean/blanket_impl.rs b/src/librustdoc/clean/blanket_impl.rs index ed0056ed26251..ea8f892016c6d 100644 --- a/src/librustdoc/clean/blanket_impl.rs +++ b/src/librustdoc/clean/blanket_impl.rs @@ -21,12 +21,12 @@ use super::*; use self::def_ctor::{get_def_from_def_id, get_def_from_node_id}; -pub struct BlanketImplFinder<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> { - pub cx: &'a core::DocContext<'a, 'tcx, 'rcx, 'cstore>, +pub struct BlanketImplFinder<'a, 'tcx: 'a, 'rcx: 'a> { + pub cx: &'a core::DocContext<'a, 'tcx, 'rcx>, } -impl<'a, 'tcx, 'rcx, 'cstore> BlanketImplFinder <'a, 'tcx, 'rcx, 'cstore> { - pub fn new(cx: &'a core::DocContext<'a, 'tcx, 'rcx, 'cstore>) -> Self { +impl<'a, 'tcx, 'rcx> BlanketImplFinder <'a, 'tcx, 'rcx> { + pub fn new(cx: &'a core::DocContext<'a, 'tcx, 'rcx>) -> Self { BlanketImplFinder { cx } } diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 64f66d55fc63d..8e8218684235f 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -149,7 +149,7 @@ pub struct Crate { pub masked_crates: FxHashSet, } -impl<'a, 'tcx, 'rcx, 'cstore> Clean for visit_ast::RustdocVisitor<'a, 'tcx, 'rcx, 'cstore> { +impl<'a, 'tcx, 'rcx> Clean for visit_ast::RustdocVisitor<'a, 'tcx, 'rcx> { fn clean(&self, cx: &DocContext) -> Crate { use ::visit_lib::LibEmbargoVisitor; diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 047d35579444f..fff2eff405822 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -55,9 +55,9 @@ pub use rustc::session::search_paths::SearchPaths; pub type ExternalPaths = FxHashMap, clean::TypeKind)>; -pub struct DocContext<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> { +pub struct DocContext<'a, 'tcx: 'a, 'rcx: 'a> { pub tcx: TyCtxt<'a, 'tcx, 'tcx>, - pub resolver: &'a RefCell>, + pub resolver: &'a RefCell>, /// The stack of module NodeIds up till this point pub crate_name: Option, pub cstore: Rc, @@ -88,7 +88,7 @@ pub struct DocContext<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> { pub all_traits: Vec, } -impl<'a, 'tcx, 'rcx, 'cstore> DocContext<'a, 'tcx, 'rcx, 'cstore> { +impl<'a, 'tcx, 'rcx> DocContext<'a, 'tcx, 'rcx> { pub fn sess(&self) -> &session::Session { &self.tcx.sess } diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index 426d3f3eeeaa2..7df8cfd97215d 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -53,14 +53,14 @@ enum PathKind { Type, } -struct LinkCollector<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> { - cx: &'a DocContext<'a, 'tcx, 'rcx, 'cstore>, +struct LinkCollector<'a, 'tcx: 'a, 'rcx: 'a> { + cx: &'a DocContext<'a, 'tcx, 'rcx>, mod_ids: Vec, is_nightly_build: bool, } -impl<'a, 'tcx, 'rcx, 'cstore> LinkCollector<'a, 'tcx, 'rcx, 'cstore> { - fn new(cx: &'a DocContext<'a, 'tcx, 'rcx, 'cstore>) -> Self { +impl<'a, 'tcx, 'rcx> LinkCollector<'a, 'tcx, 'rcx> { + fn new(cx: &'a DocContext<'a, 'tcx, 'rcx>) -> Self { LinkCollector { cx, mod_ids: Vec::new(), @@ -213,7 +213,7 @@ impl<'a, 'tcx, 'rcx, 'cstore> LinkCollector<'a, 'tcx, 'rcx, 'cstore> { } } -impl<'a, 'tcx, 'rcx, 'cstore> DocFolder for LinkCollector<'a, 'tcx, 'rcx, 'cstore> { +impl<'a, 'tcx, 'rcx> DocFolder for LinkCollector<'a, 'tcx, 'rcx> { fn fold_item(&mut self, mut item: Item) -> Option { let item_node_id = if item.is_mod() { if let Some(id) = self.cx.tcx.hir().as_local_node_id(item.def_id) { diff --git a/src/librustdoc/passes/collect_trait_impls.rs b/src/librustdoc/passes/collect_trait_impls.rs index 8847fb8128eec..80a906c9f435c 100644 --- a/src/librustdoc/passes/collect_trait_impls.rs +++ b/src/librustdoc/passes/collect_trait_impls.rs @@ -147,13 +147,13 @@ pub fn collect_trait_impls(krate: Crate, cx: &DocContext) -> Crate { krate } -struct SyntheticImplCollector<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> { - cx: &'a DocContext<'a, 'tcx, 'rcx, 'cstore>, +struct SyntheticImplCollector<'a, 'tcx: 'a, 'rcx: 'a> { + cx: &'a DocContext<'a, 'tcx, 'rcx>, impls: Vec, } -impl<'a, 'tcx, 'rcx, 'cstore> SyntheticImplCollector<'a, 'tcx, 'rcx, 'cstore> { - fn new(cx: &'a DocContext<'a, 'tcx, 'rcx, 'cstore>) -> Self { +impl<'a, 'tcx, 'rcx> SyntheticImplCollector<'a, 'tcx, 'rcx> { + fn new(cx: &'a DocContext<'a, 'tcx, 'rcx>) -> Self { SyntheticImplCollector { cx, impls: Vec::new(), @@ -161,7 +161,7 @@ impl<'a, 'tcx, 'rcx, 'cstore> SyntheticImplCollector<'a, 'tcx, 'rcx, 'cstore> { } } -impl<'a, 'tcx, 'rcx, 'cstore> DocFolder for SyntheticImplCollector<'a, 'tcx, 'rcx, 'cstore> { +impl<'a, 'tcx, 'rcx> DocFolder for SyntheticImplCollector<'a, 'tcx, 'rcx> { fn fold_item(&mut self, i: Item) -> Option { if i.is_struct() || i.is_enum() || i.is_union() { if let (Some(node_id), Some(name)) = diff --git a/src/librustdoc/passes/mod.rs b/src/librustdoc/passes/mod.rs index eee7278e4f0a9..aca371f92ac9e 100644 --- a/src/librustdoc/passes/mod.rs +++ b/src/librustdoc/passes/mod.rs @@ -361,8 +361,8 @@ impl fold::DocFolder for ImportStripper { } } -pub fn look_for_tests<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx>( - cx: &'a DocContext<'a, 'tcx, 'rcx, 'cstore>, +pub fn look_for_tests<'a, 'tcx: 'a, 'rcx: 'a>( + cx: &'a DocContext<'a, 'tcx, 'rcx>, dox: &str, item: &Item, check_missing_code: bool, diff --git a/src/librustdoc/passes/private_items_doc_tests.rs b/src/librustdoc/passes/private_items_doc_tests.rs index 7c5ce8894b106..cd8e039764c4b 100644 --- a/src/librustdoc/passes/private_items_doc_tests.rs +++ b/src/librustdoc/passes/private_items_doc_tests.rs @@ -19,12 +19,12 @@ pub const CHECK_PRIVATE_ITEMS_DOC_TESTS: Pass = Pass::early("check-private-items-doc-tests", check_private_items_doc_tests, "check private items doc tests"); -struct PrivateItemDocTestLinter<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> { - cx: &'a DocContext<'a, 'tcx, 'rcx, 'cstore>, +struct PrivateItemDocTestLinter<'a, 'tcx: 'a, 'rcx: 'a> { + cx: &'a DocContext<'a, 'tcx, 'rcx>, } -impl<'a, 'tcx, 'rcx, 'cstore> PrivateItemDocTestLinter<'a, 'tcx, 'rcx, 'cstore> { - fn new(cx: &'a DocContext<'a, 'tcx, 'rcx, 'cstore>) -> Self { +impl<'a, 'tcx, 'rcx> PrivateItemDocTestLinter<'a, 'tcx, 'rcx> { + fn new(cx: &'a DocContext<'a, 'tcx, 'rcx>) -> Self { PrivateItemDocTestLinter { cx, } @@ -37,7 +37,7 @@ pub fn check_private_items_doc_tests(krate: Crate, cx: &DocContext) -> Crate { coll.fold_crate(krate) } -impl<'a, 'tcx, 'rcx, 'cstore> DocFolder for PrivateItemDocTestLinter<'a, 'tcx, 'rcx, 'cstore> { +impl<'a, 'tcx, 'rcx> DocFolder for PrivateItemDocTestLinter<'a, 'tcx, 'rcx> { fn fold_item(&mut self, item: Item) -> Option { let cx = self.cx; let dox = item.attrs.collapsed_doc_value().unwrap_or_else(String::new); diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 004be1cfe39c4..917966423af69 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -36,10 +36,10 @@ use doctree::*; // Also, is there some reason that this doesn't use the 'visit' // framework from syntax?. -pub struct RustdocVisitor<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> { +pub struct RustdocVisitor<'a, 'tcx: 'a, 'rcx: 'a> { pub module: Module, pub attrs: hir::HirVec, - pub cx: &'a core::DocContext<'a, 'tcx, 'rcx, 'cstore>, + pub cx: &'a core::DocContext<'a, 'tcx, 'rcx>, view_item_stack: FxHashSet, inlining: bool, /// Are the current module and all of its parents public? @@ -47,10 +47,10 @@ pub struct RustdocVisitor<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> { exact_paths: Option>>, } -impl<'a, 'tcx, 'rcx, 'cstore> RustdocVisitor<'a, 'tcx, 'rcx, 'cstore> { +impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> { pub fn new( - cx: &'a core::DocContext<'a, 'tcx, 'rcx, 'cstore> - ) -> RustdocVisitor<'a, 'tcx, 'rcx, 'cstore> { + cx: &'a core::DocContext<'a, 'tcx, 'rcx> + ) -> RustdocVisitor<'a, 'tcx, 'rcx> { // If the root is re-exported, terminate all recursion. let mut stack = FxHashSet::default(); stack.insert(ast::CRATE_NODE_ID); diff --git a/src/librustdoc/visit_lib.rs b/src/librustdoc/visit_lib.rs index f64334a821981..391a222f5f503 100644 --- a/src/librustdoc/visit_lib.rs +++ b/src/librustdoc/visit_lib.rs @@ -22,8 +22,8 @@ use clean::{AttributesExt, NestedAttributesExt}; /// Similar to `librustc_privacy::EmbargoVisitor`, but also takes /// specific rustdoc annotations into account (i.e., `doc(hidden)`) -pub struct LibEmbargoVisitor<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> { - cx: &'a ::core::DocContext<'a, 'tcx, 'rcx, 'cstore>, +pub struct LibEmbargoVisitor<'a, 'tcx: 'a, 'rcx: 'a> { + cx: &'a ::core::DocContext<'a, 'tcx, 'rcx>, // Accessibility levels for reachable nodes access_levels: RefMut<'a, AccessLevels>, // Previous accessibility level, None means unreachable @@ -32,10 +32,10 @@ pub struct LibEmbargoVisitor<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> { visited_mods: FxHashSet, } -impl<'a, 'tcx, 'rcx, 'cstore> LibEmbargoVisitor<'a, 'tcx, 'rcx, 'cstore> { +impl<'a, 'tcx, 'rcx> LibEmbargoVisitor<'a, 'tcx, 'rcx> { pub fn new( - cx: &'a ::core::DocContext<'a, 'tcx, 'rcx, 'cstore> - ) -> LibEmbargoVisitor<'a, 'tcx, 'rcx, 'cstore> { + cx: &'a ::core::DocContext<'a, 'tcx, 'rcx> + ) -> LibEmbargoVisitor<'a, 'tcx, 'rcx> { LibEmbargoVisitor { cx, access_levels: RefMut::map(cx.renderinfo.borrow_mut(), |ri| &mut ri.access_levels),