Skip to content

Commit a9bf2ca

Browse files
authored
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
2 parents 57794b1 + 8851e4f commit a9bf2ca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/parser/src/lexed_str.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,13 @@ impl<'a> Converter<'a> {
198198
}
199199
LIFETIME_IDENT
200200
}
201+
rustc_lexer::TokenKind::UnknownPrefixLifetime => {
202+
err = "Unknown lifetime prefix";
203+
LIFETIME_IDENT
204+
}
205+
rustc_lexer::TokenKind::RawLifetime => {
206+
LIFETIME_IDENT
207+
}
201208

202209
rustc_lexer::TokenKind::Semi => T![;],
203210
rustc_lexer::TokenKind::Comma => T![,],

0 commit comments

Comments
 (0)