-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Rust 2015 and 2018 allow emoji in identifiers in "Unknown prefix" position #123696
Copy link
Copy link
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.
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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
In the 2015 and 2018 editions, the following compiles (with warnings):
playground
The 🐛 is taken as an identifier, although emoji aren't generally permitted in identifiers in any edition.
I tested with
rustc1.77.1.I think the underlying problem is that
ident_or_unknown_prefix()andfake_ident_or_unknown_prefix()inrustc_lexerdistinguish "identifiers" containing emoji (asInvalidIdentrather thanIdent), but don't have a way to make that distinction forUnknownPrefix.