Emoji in label/lifetime recovered as character literal (rather than identifier) #108019
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
or something else similar to the one for
Perhaps with a
=help
"did you mean to use a character literal?" when applicableRationale and extra context
I feel the rationale is self-explanatory, however, if it ends up not being such, I can provide one upon request.
Other cases
small aside: I originally wrote this all for
🥺
, but that is bizarrely not recognized in idents at all (it gives aerror: unknown start of token: \u{1f97a}
), and after realizing that some emotes are handled better, I decided to use to use🐱
. I specifically avoided🦀
because it has extra-special handling ("Ferris cannot be used as an identifier")Another case is, as mentioned prior, in lifetime names (as far as I'm aware, this is the same underlying cause: the emoji causes the token to be a character literal):
which gives 2 errors:
The following sample also has very different output (and probably closer to the expected output, although it's not without its own weirdness):
Anything else?
No response
The text was updated successfully, but these errors were encountered: