Skip to content

Commit 1894f78

Browse files
committed
Revert "Fix rust-analyzer"
This reverts commit 69d5e29.
1 parent 7cb54ed commit 1894f78

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/tools/rust-analyzer/crates/parser/src/lexed_str.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,9 @@ impl<'a> Converter<'a> {
255255
return;
256256
}
257257

258-
rustc_lexer::TokenKind::Lifetime { invalid } => {
259-
if *invalid {
260-
errors.push("Lifetime name contains invalid characters".into());
258+
rustc_lexer::TokenKind::Lifetime { starts_with_number } => {
259+
if *starts_with_number {
260+
errors.push("Lifetime name cannot start with a number".into());
261261
}
262262
LIFETIME_IDENT
263263
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
LIFETIME_IDENT "'1" error: Lifetime name contains invalid characters
1+
LIFETIME_IDENT "'1" error: Lifetime name cannot start with a number
22
WHITESPACE "\n"
3-
LIFETIME_IDENT "'1lifetime" error: Lifetime name contains invalid characters
3+
LIFETIME_IDENT "'1lifetime" error: Lifetime name cannot start with a number
44
WHITESPACE "\n"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
LIFETIME_IDENT "'1" error: Lifetime name contains invalid characters
1+
LIFETIME_IDENT "'1" error: Lifetime name cannot start with a number
22
WHITESPACE "\n"
3-
LIFETIME_IDENT "'1lifetime" error: Lifetime name contains invalid characters
3+
LIFETIME_IDENT "'1lifetime" error: Lifetime name cannot start with a number
44
WHITESPACE "\n"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
LIFETIME_IDENT "'🦀" error: Lifetime name contains invalid characters
1+
CHAR "'🦀" error: Missing trailing `'` symbol to terminate the character literal

src/tools/rust-analyzer/crates/proc-macro-srv/src/token_stream.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ impl<S> TokenStream<S> {
302302
span: span.derive_ranged(range),
303303
}))
304304
}
305-
rustc_lexer::TokenKind::Lifetime { invalid } => {
306-
if invalid {
307-
return Err(format!("Invalid lifetime identifier: `{}`", &s[range]));
305+
rustc_lexer::TokenKind::Lifetime { starts_with_number } => {
306+
if starts_with_number {
307+
return Err("Lifetime cannot start with a number".to_owned());
308308
}
309309
let range = range.start + 1..range.end;
310310
tokenstream.push(TokenTree::Punct(Punct {

0 commit comments

Comments
 (0)