Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/lexed_str.rs')
-rw-r--r--crates/parser/src/lexed_str.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/parser/src/lexed_str.rs b/crates/parser/src/lexed_str.rs
index 7ea23b4f75..5322463a71 100644
--- a/crates/parser/src/lexed_str.rs
+++ b/crates/parser/src/lexed_str.rs
@@ -188,10 +188,11 @@ impl<'a> Converter<'a> {
rustc_lexer::TokenKind::RawIdent => IDENT,
- rustc_lexer::TokenKind::GuardedStrPrefix => {
+ rustc_lexer::TokenKind::GuardedStrPrefix if self.edition.at_least_2024() => {
err = "Invalid string literal (reserved syntax)";
ERROR
- },
+ }
+ rustc_lexer::TokenKind::GuardedStrPrefix => POUND,
rustc_lexer::TokenKind::Literal { kind, .. } => {
self.extend_literal(token_text.len(), kind);