Auto merge of #104048 - cjgillot:split-lifetime, r=compiler-errors
Separate lifetime ident from lifetime resolution in HIR Drive-by: change how suggested generic args are computed. Fixes https://github.com/rust-lang/rust/issues/103815 I recommend reviewing commit-by-commit.
This commit is contained in:
commit
454784afba
49 changed files with 581 additions and 435 deletions
|
@ -1838,6 +1838,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
|||
|
||||
let outer_failures = take(&mut self.diagnostic_metadata.current_elision_failures);
|
||||
let output_rib = if let Ok(res) = elision_lifetime.as_ref() {
|
||||
self.r.lifetime_elision_allowed.insert(fn_id);
|
||||
LifetimeRibKind::Elided(*res)
|
||||
} else {
|
||||
LifetimeRibKind::ElisionFailure
|
||||
|
|
|
@ -1036,6 +1036,8 @@ pub struct Resolver<'a> {
|
|||
/// they are declared in the static array generated by proc_macro_harness.
|
||||
proc_macros: Vec<NodeId>,
|
||||
confused_type_with_std_module: FxHashMap<Span, Span>,
|
||||
/// Whether lifetime elision was successful.
|
||||
lifetime_elision_allowed: FxHashSet<NodeId>,
|
||||
|
||||
effective_visibilities: EffectiveVisibilities,
|
||||
}
|
||||
|
@ -1354,6 +1356,7 @@ impl<'a> Resolver<'a> {
|
|||
trait_impls: Default::default(),
|
||||
proc_macros: Default::default(),
|
||||
confused_type_with_std_module: Default::default(),
|
||||
lifetime_elision_allowed: Default::default(),
|
||||
effective_visibilities: Default::default(),
|
||||
};
|
||||
|
||||
|
@ -1448,6 +1451,7 @@ impl<'a> Resolver<'a> {
|
|||
def_id_to_node_id: self.def_id_to_node_id,
|
||||
trait_map: self.trait_map,
|
||||
builtin_macro_kinds: self.builtin_macro_kinds,
|
||||
lifetime_elision_allowed: self.lifetime_elision_allowed,
|
||||
};
|
||||
ResolverOutputs { definitions, global_ctxt, ast_lowering }
|
||||
}
|
||||
|
@ -1491,6 +1495,7 @@ impl<'a> Resolver<'a> {
|
|||
def_id_to_node_id: self.def_id_to_node_id.clone(),
|
||||
trait_map: self.trait_map.clone(),
|
||||
builtin_macro_kinds: self.builtin_macro_kinds.clone(),
|
||||
lifetime_elision_allowed: self.lifetime_elision_allowed.clone(),
|
||||
};
|
||||
ResolverOutputs { definitions, global_ctxt, ast_lowering }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue