Rollup merge of #125258 - compiler-errors:static-if-no-lt, r=nnethercote
Resolve elided lifetimes in assoc const to static if no other lifetimes are in scope Implements the change to elided lifetime resolution in *associated consts* subject to FCP here: https://github.com/rust-lang/rust/issues/125190#issue-2301532282 Specifically, walk the enclosing lifetime ribs in an associated const, and if we find no other lifetimes, then resolve to `'static`. Also make it work for traits, but don't lint -- just give a hard error in that case.
This commit is contained in:
commit
23b936f981
21 changed files with 385 additions and 209 deletions
|
@ -2873,6 +2873,8 @@ pub struct AssociatedConstElidedLifetime {
|
|||
|
||||
pub code: &'static str,
|
||||
pub elided: bool,
|
||||
#[note]
|
||||
pub lifetimes_in_scope: MultiSpan,
|
||||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue