Closed
Description
In the 2015 and 2018 editions, the following compiles (with warnings):
macro_rules! lexes {($($_:tt)*) => {}}
lexes!(🐛#);
lexes!(🐛"foo");
lexes!(🐛'q');
lexes!(🐛'q);
The 🐛 is taken as an identifier, although emoji aren't generally permitted in identifiers in any edition.
I tested with rustc
1.77.1.
I think the underlying problem is that ident_or_unknown_prefix()
and fake_ident_or_unknown_prefix()
in rustc_lexer
distinguish "identifiers" containing emoji (as InvalidIdent
rather than Ident
), but don't have a way to make that distinction for UnknownPrefix
.
Activity
fmease commentedon Apr 9, 2024
Regression from 1.57 to 1.58 (stable to stable). Very likely in #88781, cc @estebank.
Regression from error to pass. Previous error:
unknown start of token: \u{1f41b}
.apiraino commentedon Apr 10, 2024
WG-prioritization assigning priority (Zulip discussion).
@rustbot label -I-prioritize +P-low
Properly handle emojis as literal prefix in macros
12 remaining items