-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-UnicodeArea: UnicodeArea: UnicodeA-grammarArea: The grammar of RustArea: The grammar of RustC-bugCategory: This is a bug.Category: This is a bug.P-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
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
.
Houtamelo
Metadata
Metadata
Assignees
Labels
A-UnicodeArea: UnicodeArea: UnicodeA-grammarArea: The grammar of RustArea: The grammar of RustC-bugCategory: This is a bug.Category: This is a bug.P-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.