Skip to content

Commit ca7de86

Browse files
committedDec 10, 2018
Remove lifetime from Resolver
1 parent e2c329c commit ca7de86

17 files changed

+84
-84
lines changed
 

‎src/librustc_driver/driver.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -730,9 +730,9 @@ pub struct ExpansionResult {
730730
pub hir_forest: hir_map::Forest,
731731
}
732732

733-
pub struct InnerExpansionResult<'a, 'b: 'a> {
733+
pub struct InnerExpansionResult<'a> {
734734
pub expanded_crate: ast::Crate,
735-
pub resolver: Resolver<'a, 'b>,
735+
pub resolver: Resolver<'a>,
736736
pub hir_forest: hir_map::Forest,
737737
}
738738

@@ -811,7 +811,7 @@ where
811811

812812
/// Same as phase_2_configure_and_expand, but doesn't let you keep the resolver
813813
/// around
814-
pub fn phase_2_configure_and_expand_inner<'a, 'b: 'a, F>(
814+
pub fn phase_2_configure_and_expand_inner<'a, F>(
815815
sess: &'a Session,
816816
cstore: &'a CStore,
817817
mut krate: ast::Crate,
@@ -820,9 +820,9 @@ pub fn phase_2_configure_and_expand_inner<'a, 'b: 'a, F>(
820820
addl_plugins: Option<Vec<String>>,
821821
make_glob_map: MakeGlobMap,
822822
resolver_arenas: &'a ResolverArenas<'a>,
823-
crate_loader: &'a mut CrateLoader<'b>,
823+
crate_loader: &'a mut CrateLoader<'a>,
824824
after_expand: F,
825-
) -> Result<InnerExpansionResult<'a, 'b>, CompileIncomplete>
825+
) -> Result<InnerExpansionResult<'a>, CompileIncomplete>
826826
where
827827
F: FnOnce(&ast::Crate) -> CompileResult,
828828
{

‎src/librustc_resolve/build_reduced_graph.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl<'a> ToNameBinding<'a> for (Def, ty::Visibility, Span, Mark, IsMacroExport)
8383
}
8484
}
8585

86-
impl<'a, 'cl> Resolver<'a, 'cl> {
86+
impl<'a> Resolver<'a> {
8787
/// Defines `name` in namespace `ns` of module `parent` to be `def` if it is not yet defined;
8888
/// otherwise, reports an error.
8989
pub fn define<T>(&mut self, parent: Module<'a>, ident: Ident, ns: Namespace, def: T)
@@ -888,13 +888,13 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
888888
}
889889
}
890890

891-
pub struct BuildReducedGraphVisitor<'a, 'b: 'a, 'c: 'b> {
892-
pub resolver: &'a mut Resolver<'b, 'c>,
891+
pub struct BuildReducedGraphVisitor<'a, 'b: 'a> {
892+
pub resolver: &'a mut Resolver<'b>,
893893
pub current_legacy_scope: LegacyScope<'b>,
894894
pub expansion: Mark,
895895
}
896896

897-
impl<'a, 'b, 'cl> BuildReducedGraphVisitor<'a, 'b, 'cl> {
897+
impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
898898
fn visit_invoc(&mut self, id: ast::NodeId) -> &'b InvocationData<'b> {
899899
let mark = id.placeholder_to_mark();
900900
self.resolver.current_module.unresolved_invocations.borrow_mut().insert(mark);
@@ -917,7 +917,7 @@ macro_rules! method {
917917
}
918918
}
919919

920-
impl<'a, 'b, 'cl> Visitor<'a> for BuildReducedGraphVisitor<'a, 'b, 'cl> {
920+
impl<'a, 'b> Visitor<'a> for BuildReducedGraphVisitor<'a, 'b> {
921921
method!(visit_impl_item: ast::ImplItem, ast::ImplItemKind::Macro, walk_impl_item);
922922
method!(visit_expr: ast::Expr, ast::ExprKind::Mac, walk_expr);
923923
method!(visit_pat: ast::Pat, ast::PatKind::Mac, walk_pat);

‎src/librustc_resolve/check_unused.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,30 @@ use syntax::visit::{self, Visitor};
3131
use syntax_pos::{Span, MultiSpan, DUMMY_SP};
3232

3333

34-
struct UnusedImportCheckVisitor<'a, 'b: 'a, 'd: 'b> {
35-
resolver: &'a mut Resolver<'b, 'd>,
34+
struct UnusedImportCheckVisitor<'a, 'b: 'a> {
35+
resolver: &'a mut Resolver<'b>,
3636
/// All the (so far) unused imports, grouped path list
3737
unused_imports: NodeMap<NodeMap<Span>>,
3838
base_id: ast::NodeId,
3939
item_span: Span,
4040
}
4141

4242
// Deref and DerefMut impls allow treating UnusedImportCheckVisitor as Resolver.
43-
impl<'a, 'b, 'd> Deref for UnusedImportCheckVisitor<'a, 'b, 'd> {
44-
type Target = Resolver<'b, 'd>;
43+
impl<'a, 'b> Deref for UnusedImportCheckVisitor<'a, 'b> {
44+
type Target = Resolver<'b>;
4545

46-
fn deref<'c>(&'c self) -> &'c Resolver<'b, 'd> {
46+
fn deref<'c>(&'c self) -> &'c Resolver<'b> {
4747
&*self.resolver
4848
}
4949
}
5050

51-
impl<'a, 'b, 'd> DerefMut for UnusedImportCheckVisitor<'a, 'b, 'd> {
52-
fn deref_mut<'c>(&'c mut self) -> &'c mut Resolver<'b, 'd> {
51+
impl<'a, 'b> DerefMut for UnusedImportCheckVisitor<'a, 'b> {
52+
fn deref_mut<'c>(&'c mut self) -> &'c mut Resolver<'b> {
5353
&mut *self.resolver
5454
}
5555
}
5656

57-
impl<'a, 'b, 'd> UnusedImportCheckVisitor<'a, 'b, 'd> {
57+
impl<'a, 'b> UnusedImportCheckVisitor<'a, 'b> {
5858
// We have information about whether `use` (import) directives are actually
5959
// used now. If an import is not used at all, we signal a lint error.
6060
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> {
7777
}
7878
}
7979

80-
impl<'a, 'b, 'cl> Visitor<'a> for UnusedImportCheckVisitor<'a, 'b, 'cl> {
80+
impl<'a, 'b> Visitor<'a> for UnusedImportCheckVisitor<'a, 'b> {
8181
fn visit_item(&mut self, item: &'a ast::Item) {
8282
self.item_span = item.span;
8383

‎src/librustc_resolve/error_reporting.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use syntax_pos::Span;
1717
use resolve_imports::ImportResolver;
1818
use std::cmp::Reverse;
1919

20-
impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
20+
impl<'a, 'b:'a> ImportResolver<'a, 'b> {
2121
/// Add suggestions for a path that cannot be resolved.
2222
pub(crate) fn make_path_suggestion(
2323
&mut self,

‎src/librustc_resolve/lib.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ impl<'tcx> Visitor<'tcx> for UsePlacementFinder {
742742
}
743743

744744
/// This thing walks the whole crate in DFS manner, visiting each item, resolving names as it goes.
745-
impl<'a, 'tcx, 'cl> Visitor<'tcx> for Resolver<'a, 'cl> {
745+
impl<'a, 'tcx> Visitor<'tcx> for Resolver<'a> {
746746
fn visit_item(&mut self, item: &'tcx Item) {
747747
self.resolve_item(item);
748748
}
@@ -1476,7 +1476,7 @@ pub struct ExternPreludeEntry<'a> {
14761476
/// The main resolver class.
14771477
///
14781478
/// This is the visitor that walks the whole crate.
1479-
pub struct Resolver<'a, 'b: 'a> {
1479+
pub struct Resolver<'a> {
14801480
session: &'a Session,
14811481
cstore: &'a CStore,
14821482

@@ -1580,7 +1580,7 @@ pub struct Resolver<'a, 'b: 'a> {
15801580
arenas: &'a ResolverArenas<'a>,
15811581
dummy_binding: &'a NameBinding<'a>,
15821582

1583-
crate_loader: &'a mut CrateLoader<'b>,
1583+
crate_loader: &'a mut CrateLoader<'a>,
15841584
macro_names: FxHashSet<Ident>,
15851585
builtin_macros: FxHashMap<Name, &'a NameBinding<'a>>,
15861586
macro_use_prelude: FxHashMap<Name, &'a NameBinding<'a>>,
@@ -1654,7 +1654,7 @@ impl<'a> ResolverArenas<'a> {
16541654
}
16551655
}
16561656

1657-
impl<'a, 'b: 'a, 'cl: 'b> ty::DefIdTree for &'a Resolver<'b, 'cl> {
1657+
impl<'a, 'b: 'a> ty::DefIdTree for &'a Resolver<'b> {
16581658
fn parent(self, id: DefId) -> Option<DefId> {
16591659
match id.krate {
16601660
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> {
16651665

16661666
/// This interface is used through the AST→HIR step, to embed full paths into the HIR. After that
16671667
/// the resolver is no longer needed as all the relevant information is inline.
1668-
impl<'a, 'cl> hir::lowering::Resolver for Resolver<'a, 'cl> {
1668+
impl<'a> hir::lowering::Resolver for Resolver<'a> {
16691669
fn resolve_hir_path(
16701670
&mut self,
16711671
path: &ast::Path,
@@ -1711,7 +1711,7 @@ impl<'a, 'cl> hir::lowering::Resolver for Resolver<'a, 'cl> {
17111711
}
17121712
}
17131713

1714-
impl<'a, 'crateloader> Resolver<'a, 'crateloader> {
1714+
impl<'a> Resolver<'a> {
17151715
/// Rustdoc uses this to resolve things in a recoverable way. ResolutionError<'a>
17161716
/// isn't something that can be returned because it can't be made to live that long,
17171717
/// 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> {
18001800
}
18011801
}
18021802

1803-
impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
1803+
impl<'a> Resolver<'a> {
18041804
pub fn new(session: &'a Session,
18051805
cstore: &'a CStore,
18061806
krate: &Crate,
18071807
crate_name: &str,
18081808
make_glob_map: MakeGlobMap,
1809-
crate_loader: &'a mut CrateLoader<'crateloader>,
1809+
crate_loader: &'a mut CrateLoader<'a>,
18101810
arenas: &'a ResolverArenas<'a>)
1811-
-> Resolver<'a, 'crateloader> {
1811+
-> Resolver<'a> {
18121812
let root_def_id = DefId::local(CRATE_DEF_INDEX);
18131813
let root_module_kind = ModuleKind::Def(Def::Mod(root_def_id), keywords::Invalid.name());
18141814
let graph_root = arenas.alloc_module(ModuleData {

‎src/librustc_resolve/macros.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ fn sub_namespace_match(candidate: Option<MacroKind>, requirement: Option<MacroKi
121121
candidate.is_none() || requirement.is_none() || candidate == requirement
122122
}
123123

124-
impl<'a, 'crateloader: 'a> base::Resolver for Resolver<'a, 'crateloader> {
124+
impl<'a> base::Resolver for Resolver<'a> {
125125
fn next_node_id(&mut self) -> ast::NodeId {
126126
self.session.next_node_id()
127127
}
@@ -139,11 +139,11 @@ impl<'a, 'crateloader: 'a> base::Resolver for Resolver<'a, 'crateloader> {
139139
}
140140

141141
fn eliminate_crate_var(&mut self, item: P<ast::Item>) -> P<ast::Item> {
142-
struct EliminateCrateVar<'b, 'a: 'b, 'crateloader: 'a>(
143-
&'b mut Resolver<'a, 'crateloader>, Span
142+
struct EliminateCrateVar<'b, 'a: 'b>(
143+
&'b mut Resolver<'a>, Span
144144
);
145145

146-
impl<'a, 'b, 'crateloader> Folder for EliminateCrateVar<'a, 'b, 'crateloader> {
146+
impl<'a, 'b> Folder for EliminateCrateVar<'a, 'b> {
147147
fn fold_path(&mut self, path: ast::Path) -> ast::Path {
148148
match self.fold_qpath(None, path) {
149149
(None, path) => path,
@@ -290,7 +290,7 @@ impl<'a, 'crateloader: 'a> base::Resolver for Resolver<'a, 'crateloader> {
290290
}
291291
}
292292

293-
impl<'a, 'cl> Resolver<'a, 'cl> {
293+
impl<'a> Resolver<'a> {
294294
pub fn dummy_parent_scope(&self) -> ParentScope<'a> {
295295
self.invoc_parent_scope(Mark::root(), Vec::new())
296296
}

‎src/librustc_resolve/resolve_imports.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl<'a> NameResolution<'a> {
134134
}
135135
}
136136

137-
impl<'a, 'crateloader> Resolver<'a, 'crateloader> {
137+
impl<'a> Resolver<'a> {
138138
fn resolution(&self, module: Module<'a>, ident: Ident, ns: Namespace)
139139
-> &'a RefCell<NameResolution<'a>> {
140140
*module.resolutions.borrow_mut().entry((ident.modern(), ns))
@@ -541,7 +541,7 @@ impl<'a, 'crateloader> Resolver<'a, 'crateloader> {
541541
// If the resolution becomes a success, define it in the module's glob importers.
542542
fn update_resolution<T, F>(&mut self, module: Module<'a>, ident: Ident, ns: Namespace, f: F)
543543
-> T
544-
where F: FnOnce(&mut Resolver<'a, 'crateloader>, &mut NameResolution<'a>) -> T
544+
where F: FnOnce(&mut Resolver<'a>, &mut NameResolution<'a>) -> T
545545
{
546546
// Ensure that `resolution` isn't borrowed when defining in the module's glob importers,
547547
// during which the resolution might end up getting re-defined via a glob cycle.
@@ -592,30 +592,30 @@ impl<'a, 'crateloader> Resolver<'a, 'crateloader> {
592592
}
593593
}
594594

595-
pub struct ImportResolver<'a, 'b: 'a, 'c: 'a + 'b> {
596-
pub resolver: &'a mut Resolver<'b, 'c>,
595+
pub struct ImportResolver<'a, 'b: 'a> {
596+
pub resolver: &'a mut Resolver<'b>,
597597
}
598598

599-
impl<'a, 'b: 'a, 'c: 'a + 'b> ::std::ops::Deref for ImportResolver<'a, 'b, 'c> {
600-
type Target = Resolver<'b, 'c>;
601-
fn deref(&self) -> &Resolver<'b, 'c> {
599+
impl<'a, 'b: 'a> ::std::ops::Deref for ImportResolver<'a, 'b> {
600+
type Target = Resolver<'b>;
601+
fn deref(&self) -> &Resolver<'b> {
602602
self.resolver
603603
}
604604
}
605605

606-
impl<'a, 'b: 'a, 'c: 'a + 'b> ::std::ops::DerefMut for ImportResolver<'a, 'b, 'c> {
607-
fn deref_mut(&mut self) -> &mut Resolver<'b, 'c> {
606+
impl<'a, 'b: 'a> ::std::ops::DerefMut for ImportResolver<'a, 'b> {
607+
fn deref_mut(&mut self) -> &mut Resolver<'b> {
608608
self.resolver
609609
}
610610
}
611611

612-
impl<'a, 'b: 'a, 'c: 'a + 'b> ty::DefIdTree for &'a ImportResolver<'a, 'b, 'c> {
612+
impl<'a, 'b: 'a> ty::DefIdTree for &'a ImportResolver<'a, 'b> {
613613
fn parent(self, id: DefId) -> Option<DefId> {
614614
self.resolver.parent(id)
615615
}
616616
}
617617

618-
impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
618+
impl<'a, 'b:'a> ImportResolver<'a, 'b> {
619619
// Import resolution
620620
//
621621
// This is a fixed-point algorithm. We resolve imports until our efforts

‎src/librustdoc/clean/auto_trait.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ use self::def_ctor::{get_def_from_def_id, get_def_from_node_id};
1717

1818
use super::*;
1919

20-
pub struct AutoTraitFinder<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> {
21-
pub cx: &'a core::DocContext<'a, 'tcx, 'rcx, 'cstore>,
20+
pub struct AutoTraitFinder<'a, 'tcx: 'a, 'rcx: 'a> {
21+
pub cx: &'a core::DocContext<'a, 'tcx, 'rcx>,
2222
pub f: auto::AutoTraitFinder<'a, 'tcx>,
2323
}
2424

25-
impl<'a, 'tcx, 'rcx, 'cstore> AutoTraitFinder<'a, 'tcx, 'rcx, 'cstore> {
26-
pub fn new(cx: &'a core::DocContext<'a, 'tcx, 'rcx, 'cstore>) -> Self {
25+
impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
26+
pub fn new(cx: &'a core::DocContext<'a, 'tcx, 'rcx>) -> Self {
2727
let f = auto::AutoTraitFinder::new(&cx.tcx);
2828

2929
AutoTraitFinder { cx, f }

‎src/librustdoc/clean/blanket_impl.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ use super::*;
2121

2222
use self::def_ctor::{get_def_from_def_id, get_def_from_node_id};
2323

24-
pub struct BlanketImplFinder<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> {
25-
pub cx: &'a core::DocContext<'a, 'tcx, 'rcx, 'cstore>,
24+
pub struct BlanketImplFinder<'a, 'tcx: 'a, 'rcx: 'a> {
25+
pub cx: &'a core::DocContext<'a, 'tcx, 'rcx>,
2626
}
2727

28-
impl<'a, 'tcx, 'rcx, 'cstore> BlanketImplFinder <'a, 'tcx, 'rcx, 'cstore> {
29-
pub fn new(cx: &'a core::DocContext<'a, 'tcx, 'rcx, 'cstore>) -> Self {
28+
impl<'a, 'tcx, 'rcx> BlanketImplFinder <'a, 'tcx, 'rcx> {
29+
pub fn new(cx: &'a core::DocContext<'a, 'tcx, 'rcx>) -> Self {
3030
BlanketImplFinder { cx }
3131
}
3232

‎src/librustdoc/clean/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ pub struct Crate {
149149
pub masked_crates: FxHashSet<CrateNum>,
150150
}
151151

152-
impl<'a, 'tcx, 'rcx, 'cstore> Clean<Crate> for visit_ast::RustdocVisitor<'a, 'tcx, 'rcx, 'cstore> {
152+
impl<'a, 'tcx, 'rcx> Clean<Crate> for visit_ast::RustdocVisitor<'a, 'tcx, 'rcx> {
153153
fn clean(&self, cx: &DocContext) -> Crate {
154154
use ::visit_lib::LibEmbargoVisitor;
155155

‎src/librustdoc/core.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ pub use rustc::session::search_paths::SearchPaths;
5555

5656
pub type ExternalPaths = FxHashMap<DefId, (Vec<String>, clean::TypeKind)>;
5757

58-
pub struct DocContext<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> {
58+
pub struct DocContext<'a, 'tcx: 'a, 'rcx: 'a> {
5959
pub tcx: TyCtxt<'a, 'tcx, 'tcx>,
60-
pub resolver: &'a RefCell<resolve::Resolver<'rcx, 'cstore>>,
60+
pub resolver: &'a RefCell<resolve::Resolver<'rcx>>,
6161
/// The stack of module NodeIds up till this point
6262
pub crate_name: Option<String>,
6363
pub cstore: Rc<CStore>,
@@ -88,7 +88,7 @@ pub struct DocContext<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> {
8888
pub all_traits: Vec<DefId>,
8989
}
9090

91-
impl<'a, 'tcx, 'rcx, 'cstore> DocContext<'a, 'tcx, 'rcx, 'cstore> {
91+
impl<'a, 'tcx, 'rcx> DocContext<'a, 'tcx, 'rcx> {
9292
pub fn sess(&self) -> &session::Session {
9393
&self.tcx.sess
9494
}

‎src/librustdoc/passes/collect_intra_doc_links.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ enum PathKind {
5353
Type,
5454
}
5555

56-
struct LinkCollector<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> {
57-
cx: &'a DocContext<'a, 'tcx, 'rcx, 'cstore>,
56+
struct LinkCollector<'a, 'tcx: 'a, 'rcx: 'a> {
57+
cx: &'a DocContext<'a, 'tcx, 'rcx>,
5858
mod_ids: Vec<NodeId>,
5959
is_nightly_build: bool,
6060
}
6161

62-
impl<'a, 'tcx, 'rcx, 'cstore> LinkCollector<'a, 'tcx, 'rcx, 'cstore> {
63-
fn new(cx: &'a DocContext<'a, 'tcx, 'rcx, 'cstore>) -> Self {
62+
impl<'a, 'tcx, 'rcx> LinkCollector<'a, 'tcx, 'rcx> {
63+
fn new(cx: &'a DocContext<'a, 'tcx, 'rcx>) -> Self {
6464
LinkCollector {
6565
cx,
6666
mod_ids: Vec::new(),
@@ -213,7 +213,7 @@ impl<'a, 'tcx, 'rcx, 'cstore> LinkCollector<'a, 'tcx, 'rcx, 'cstore> {
213213
}
214214
}
215215

216-
impl<'a, 'tcx, 'rcx, 'cstore> DocFolder for LinkCollector<'a, 'tcx, 'rcx, 'cstore> {
216+
impl<'a, 'tcx, 'rcx> DocFolder for LinkCollector<'a, 'tcx, 'rcx> {
217217
fn fold_item(&mut self, mut item: Item) -> Option<Item> {
218218
let item_node_id = if item.is_mod() {
219219
if let Some(id) = self.cx.tcx.hir().as_local_node_id(item.def_id) {

‎src/librustdoc/passes/collect_trait_impls.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -147,21 +147,21 @@ pub fn collect_trait_impls(krate: Crate, cx: &DocContext) -> Crate {
147147
krate
148148
}
149149

150-
struct SyntheticImplCollector<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> {
151-
cx: &'a DocContext<'a, 'tcx, 'rcx, 'cstore>,
150+
struct SyntheticImplCollector<'a, 'tcx: 'a, 'rcx: 'a> {
151+
cx: &'a DocContext<'a, 'tcx, 'rcx>,
152152
impls: Vec<Item>,
153153
}
154154

155-
impl<'a, 'tcx, 'rcx, 'cstore> SyntheticImplCollector<'a, 'tcx, 'rcx, 'cstore> {
156-
fn new(cx: &'a DocContext<'a, 'tcx, 'rcx, 'cstore>) -> Self {
155+
impl<'a, 'tcx, 'rcx> SyntheticImplCollector<'a, 'tcx, 'rcx> {
156+
fn new(cx: &'a DocContext<'a, 'tcx, 'rcx>) -> Self {
157157
SyntheticImplCollector {
158158
cx,
159159
impls: Vec::new(),
160160
}
161161
}
162162
}
163163

164-
impl<'a, 'tcx, 'rcx, 'cstore> DocFolder for SyntheticImplCollector<'a, 'tcx, 'rcx, 'cstore> {
164+
impl<'a, 'tcx, 'rcx> DocFolder for SyntheticImplCollector<'a, 'tcx, 'rcx> {
165165
fn fold_item(&mut self, i: Item) -> Option<Item> {
166166
if i.is_struct() || i.is_enum() || i.is_union() {
167167
if let (Some(node_id), Some(name)) =

‎src/librustdoc/passes/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ impl fold::DocFolder for ImportStripper {
361361
}
362362
}
363363

364-
pub fn look_for_tests<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx>(
365-
cx: &'a DocContext<'a, 'tcx, 'rcx, 'cstore>,
364+
pub fn look_for_tests<'a, 'tcx: 'a, 'rcx: 'a>(
365+
cx: &'a DocContext<'a, 'tcx, 'rcx>,
366366
dox: &str,
367367
item: &Item,
368368
check_missing_code: bool,

‎src/librustdoc/passes/private_items_doc_tests.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ pub const CHECK_PRIVATE_ITEMS_DOC_TESTS: Pass =
1919
Pass::early("check-private-items-doc-tests", check_private_items_doc_tests,
2020
"check private items doc tests");
2121

22-
struct PrivateItemDocTestLinter<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> {
23-
cx: &'a DocContext<'a, 'tcx, 'rcx, 'cstore>,
22+
struct PrivateItemDocTestLinter<'a, 'tcx: 'a, 'rcx: 'a> {
23+
cx: &'a DocContext<'a, 'tcx, 'rcx>,
2424
}
2525

26-
impl<'a, 'tcx, 'rcx, 'cstore> PrivateItemDocTestLinter<'a, 'tcx, 'rcx, 'cstore> {
27-
fn new(cx: &'a DocContext<'a, 'tcx, 'rcx, 'cstore>) -> Self {
26+
impl<'a, 'tcx, 'rcx> PrivateItemDocTestLinter<'a, 'tcx, 'rcx> {
27+
fn new(cx: &'a DocContext<'a, 'tcx, 'rcx>) -> Self {
2828
PrivateItemDocTestLinter {
2929
cx,
3030
}
@@ -37,7 +37,7 @@ pub fn check_private_items_doc_tests(krate: Crate, cx: &DocContext) -> Crate {
3737
coll.fold_crate(krate)
3838
}
3939

40-
impl<'a, 'tcx, 'rcx, 'cstore> DocFolder for PrivateItemDocTestLinter<'a, 'tcx, 'rcx, 'cstore> {
40+
impl<'a, 'tcx, 'rcx> DocFolder for PrivateItemDocTestLinter<'a, 'tcx, 'rcx> {
4141
fn fold_item(&mut self, item: Item) -> Option<Item> {
4242
let cx = self.cx;
4343
let dox = item.attrs.collapsed_doc_value().unwrap_or_else(String::new);

‎src/librustdoc/visit_ast.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ use doctree::*;
3636
// Also, is there some reason that this doesn't use the 'visit'
3737
// framework from syntax?.
3838

39-
pub struct RustdocVisitor<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> {
39+
pub struct RustdocVisitor<'a, 'tcx: 'a, 'rcx: 'a> {
4040
pub module: Module,
4141
pub attrs: hir::HirVec<ast::Attribute>,
42-
pub cx: &'a core::DocContext<'a, 'tcx, 'rcx, 'cstore>,
42+
pub cx: &'a core::DocContext<'a, 'tcx, 'rcx>,
4343
view_item_stack: FxHashSet<ast::NodeId>,
4444
inlining: bool,
4545
/// Are the current module and all of its parents public?
4646
inside_public_path: bool,
4747
exact_paths: Option<FxHashMap<DefId, Vec<String>>>,
4848
}
4949

50-
impl<'a, 'tcx, 'rcx, 'cstore> RustdocVisitor<'a, 'tcx, 'rcx, 'cstore> {
50+
impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
5151
pub fn new(
52-
cx: &'a core::DocContext<'a, 'tcx, 'rcx, 'cstore>
53-
) -> RustdocVisitor<'a, 'tcx, 'rcx, 'cstore> {
52+
cx: &'a core::DocContext<'a, 'tcx, 'rcx>
53+
) -> RustdocVisitor<'a, 'tcx, 'rcx> {
5454
// If the root is re-exported, terminate all recursion.
5555
let mut stack = FxHashSet::default();
5656
stack.insert(ast::CRATE_NODE_ID);

‎src/librustdoc/visit_lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ use clean::{AttributesExt, NestedAttributesExt};
2222

2323
/// Similar to `librustc_privacy::EmbargoVisitor`, but also takes
2424
/// specific rustdoc annotations into account (i.e., `doc(hidden)`)
25-
pub struct LibEmbargoVisitor<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> {
26-
cx: &'a ::core::DocContext<'a, 'tcx, 'rcx, 'cstore>,
25+
pub struct LibEmbargoVisitor<'a, 'tcx: 'a, 'rcx: 'a> {
26+
cx: &'a ::core::DocContext<'a, 'tcx, 'rcx>,
2727
// Accessibility levels for reachable nodes
2828
access_levels: RefMut<'a, AccessLevels<DefId>>,
2929
// Previous accessibility level, None means unreachable
@@ -32,10 +32,10 @@ pub struct LibEmbargoVisitor<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> {
3232
visited_mods: FxHashSet<DefId>,
3333
}
3434

35-
impl<'a, 'tcx, 'rcx, 'cstore> LibEmbargoVisitor<'a, 'tcx, 'rcx, 'cstore> {
35+
impl<'a, 'tcx, 'rcx> LibEmbargoVisitor<'a, 'tcx, 'rcx> {
3636
pub fn new(
37-
cx: &'a ::core::DocContext<'a, 'tcx, 'rcx, 'cstore>
38-
) -> LibEmbargoVisitor<'a, 'tcx, 'rcx, 'cstore> {
37+
cx: &'a ::core::DocContext<'a, 'tcx, 'rcx>
38+
) -> LibEmbargoVisitor<'a, 'tcx, 'rcx> {
3939
LibEmbargoVisitor {
4040
cx,
4141
access_levels: RefMut::map(cx.renderinfo.borrow_mut(), |ri| &mut ri.access_levels),

0 commit comments

Comments
 (0)
Please sign in to comment.