Rollup merge of #126452 - compiler-errors:raw-lifetimes, r=spastorino
Implement raw lifetimes and labels (`'r#ident`) This PR does two things: 1. Reserve lifetime prefixes, e.g. `'prefix#lt` in edition 2021. 2. Implements raw lifetimes, e.g. `'r#async` in edition 2021. This PR additionally extends the `keyword_idents_2024` lint to also check lifetimes. cc `@traviscross` r? parser
This commit is contained in:
commit
ccf3f6e59d
40 changed files with 373 additions and 85 deletions
|
@ -363,8 +363,9 @@ pub(crate) enum BuiltinEllipsisInclusiveRangePatternsLint {
|
|||
pub(crate) struct BuiltinKeywordIdents {
|
||||
pub kw: Ident,
|
||||
pub next: Edition,
|
||||
#[suggestion(code = "r#{kw}", applicability = "machine-applicable")]
|
||||
#[suggestion(code = "{prefix}r#{kw}", applicability = "machine-applicable")]
|
||||
pub suggestion: Span,
|
||||
pub prefix: &'static str,
|
||||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
|
@ -2814,6 +2815,15 @@ pub(crate) struct ReservedPrefix {
|
|||
pub prefix: String,
|
||||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(lint_raw_prefix)]
|
||||
pub(crate) struct RawPrefix {
|
||||
#[label]
|
||||
pub label: Span,
|
||||
#[suggestion(code = " ", applicability = "machine-applicable")]
|
||||
pub suggestion: Span,
|
||||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(lint_unused_builtin_attribute)]
|
||||
pub(crate) struct UnusedBuiltinAttribute {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue