Skip to content

Commit ca1a339

Browse files
Rollup merge of #123752 - estebank:emoji-prefix, r=wesleywiser
Properly handle emojis as literal prefix in macros Do not accept the following ```rust macro_rules! lexes {($($_:tt)*) => {}} lexes!(🐛"foo"); ``` Before, invalid emoji identifiers were gated during parsing instead of lexing in all cases, but this didn't account for macro pre-expansion of literal prefixes. Fix #123696.
2 parents 2ab3444 + 8677ebb commit ca1a339

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/parser/src/lexed_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ impl<'a> Converter<'a> {
178178
rustc_lexer::TokenKind::Ident => {
179179
SyntaxKind::from_keyword(token_text).unwrap_or(IDENT)
180180
}
181-
rustc_lexer::TokenKind::InvalidIdent => {
181+
rustc_lexer::TokenKind::InvalidPrefix | rustc_lexer::TokenKind::InvalidIdent => {
182182
err = "Ident contains invalid characters";
183183
IDENT
184184
}

0 commit comments

Comments
 (0)