Introduce 'ra lifetime name.

`rustc_resolve` allocates many things in `ResolverArenas`. The lifetime
used for references into the arena is mostly `'a`, and sometimes `'b`.

This commit changes it to `'ra`, which is much more descriptive. The
commit also changes the order of lifetimes on a couple of structs so
that '`ra` is second last, before `'tcx`, and does other minor
renamings such as `'r` to `'a`.
This commit is contained in:
Nicholas Nethercote
2024-09-10 16:19:40 +10:00
parent c2f74c3f92
commit d4fc76cbf3
11 changed files with 482 additions and 471 deletions

View File

@@ -170,7 +170,7 @@ impl TypoCandidate {
}
}
impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
impl<'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
fn make_base_error(
&mut self,
path: &[Segment],
@@ -2278,7 +2278,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
false
}
fn find_module(&mut self, def_id: DefId) -> Option<(Module<'a>, ImportSuggestion)> {
fn find_module(&mut self, def_id: DefId) -> Option<(Module<'ra>, ImportSuggestion)> {
let mut result = None;
let mut seen_modules = FxHashSet::default();
let root_did = self.r.graph_root.def_id();