-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rust 2015 and 2018 allow emoji in identifiers in "Unknown prefix" position #123696
Labels
A-grammar
Area: The grammar of Rust
A-Unicode
Area: Unicode
C-bug
Category: This is a bug.
P-low
Low priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Apr 9, 2024
fmease
added
A-grammar
Area: The grammar of Rust
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Apr 9, 2024
fmease
added
the
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
label
Apr 9, 2024
rustbot
added
the
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
label
Apr 9, 2024
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-low |
rustbot
added
P-low
Low priority
and removed
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
labels
Apr 10, 2024
estebank
added a commit
to estebank/rust
that referenced
this issue
Apr 10, 2024
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 expansion of literal prefixes. Fix rust-lang#123696.
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Apr 10, 2024
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 expansion of literal prefixes. Fix rust-lang#123696.
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Apr 10, 2024
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 rust-lang#123696.
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Apr 18, 2024
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 rust-lang#123696.
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Apr 18, 2024
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 rust-lang#123696.
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Apr 18, 2024
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 rust-lang#123696.
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Apr 18, 2024
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 rust-lang#123696.
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Apr 19, 2024
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 rust-lang#123696.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Apr 19, 2024
Rollup merge of rust-lang#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 rust-lang#123696.
mattheww
added a commit
to mattheww/lexeywan
that referenced
this issue
Sep 10, 2024
This bug is now fixed in stable rustc. See rust-lang/rust#123696 rust-lang/rust#123752
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-grammar
Area: The grammar of Rust
A-Unicode
Area: Unicode
C-bug
Category: This is a bug.
P-low
Low priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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
rustc
1.77.1.I think the underlying problem is that
ident_or_unknown_prefix()
andfake_ident_or_unknown_prefix()
inrustc_lexer
distinguish "identifiers" containing emoji (asInvalidIdent
rather thanIdent
), but don't have a way to make that distinction forUnknownPrefix
.The text was updated successfully, but these errors were encountered: