From ec11c27e5c2e296e3806c746e12299b29d59f3fe Mon Sep 17 00:00:00 2001
From: Peter Jaszkowiak
Date: Sun, 14 Apr 2024 17:37:45 -0600
Subject: [PATCH] Reserve guarded string literals (RFC 3593)
---
crates/parser/src/lexed_str.rs | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/crates/parser/src/lexed_str.rs b/crates/parser/src/lexed_str.rs
index dceac815e0..7ea23b4f75 100644
--- a/crates/parser/src/lexed_str.rs
+++ b/crates/parser/src/lexed_str.rs
@@ -187,6 +187,12 @@ impl<'a> Converter<'a> {
}
rustc_lexer::TokenKind::RawIdent => IDENT,
+
+ rustc_lexer::TokenKind::GuardedStrPrefix => {
+ err = "Invalid string literal (reserved syntax)";
+ ERROR
+ },
+
rustc_lexer::TokenKind::Literal { kind, .. } => {
self.extend_literal(token_text.len(), kind);
return;