Uh oh!
There was an error while loading. Please reload this page.
Properly handle emojis as literal prefix in macros - #123752
Conversation
rustbot
commented
Apr 10, 2024
r? @wesleywiser rustbot has assigned @wesleywiser. Use |
estebank
commented
Apr 10, 2024
This can safely ride the train, but proposing for beta backport to expedite the fix landing on stable. This is an old stable-to-stable regression. Reminds me of the time we accepted any random identifier as a literal prefix with no error whatsoever 😬 |
estebank
commented
Apr 10, 2024
Just in case @bors try @craterbot check |
craterbot
commented
Apr 10, 2024
🚨 Error: missing start toolchain 🆘 If you have any trouble with Crater please ping |
estebank
commented
Apr 10, 2024
@bors try |
bors
commented
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.
Fixrust-lang#123696.
This comment has been minimized.
This comment has been minimized.
rustbot
commented
Apr 10, 2024
rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer |
This comment has been minimized.
This comment has been minimized.
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.
Fixrust-lang#123696.estebank
commented
Apr 10, 2024
@bors try |
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.
Fixrust-lang#123696.bors
commented
Apr 10, 2024
bors
commented
Apr 11, 2024
☀️ Try build successful - checks-actions |
estebank
commented
Apr 11, 2024
@craterbot check |
craterbot
commented
Apr 11, 2024
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
craterbot
commented
Apr 11, 2024
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
wesleywiser
left a comment
There was a problem hiding this comment.
Code looks good to me, let's see what crater says...
apiraino
commented
Apr 11, 2024
Beta backport declined as per compiler team on Zulip. As pointed out in this comment, it can ride the trains and reach stable on its legs 🚶 @rustbot label -beta-nominated |
craterbot
commented
Apr 12, 2024
🎉 Experiment
|
estebank
commented
Apr 12, 2024
I'm glad to see that no-one has been naughty with this oversight. |
wesleywiser
commented
Apr 18, 2024
@bors r+ |
bors
commented
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.
Fixrust-lang#123696.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.
Fixrust-lang#123696.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.
Fixrust-lang#123696.…kingjubilee Rollup of 6 pull requests Successful merges: - rust-lang#117919 (Introduce perma-unstable `wasm-c-abi` flag) - rust-lang#123571 (Correctly change type when adding adjustments on top of `NeverToAny`) - rust-lang#123752 (Properly handle emojis as literal prefix in macros) - rust-lang#123980 ( Add an opt-in to store incoming edges in `VecGraph` + misc) - rust-lang#124110 (Fix negating `f16` and `f128` constants) - rust-lang#124116 (when suggesting RUST_BACKTRACE=1, add a special note for Miri's env var isolation) r? `@ghost` `@rustbot` modify labels: rollup
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.
Fixrust-lang#123696.…kingjubilee Rollup of 9 pull requests Successful merges: - rust-lang#117919 (Introduce perma-unstable `wasm-c-abi` flag) - rust-lang#123406 (Force exhaustion in iter::ArrayChunks::into_remainder) - rust-lang#123752 (Properly handle emojis as literal prefix in macros) - rust-lang#123935 (Don't inline integer literals when they overflow - new attempt) - rust-lang#123980 ( Add an opt-in to store incoming edges in `VecGraph` + misc) - rust-lang#124019 (Use raw-dylib for Windows synchronization functions) - rust-lang#124110 (Fix negating `f16` and `f128` constants) - rust-lang#124112 (Fix ICE when there is a non-Unicode entry in the incremental crate directory) - rust-lang#124116 (when suggesting RUST_BACKTRACE=1, add a special note for Miri's env var isolation) r? `@ghost` `@rustbot` modify labels: rollup
…kingjubilee Rollup of 7 pull requests Successful merges: - rust-lang#123406 (Force exhaustion in iter::ArrayChunks::into_remainder) - rust-lang#123752 (Properly handle emojis as literal prefix in macros) - rust-lang#123935 (Don't inline integer literals when they overflow - new attempt) - rust-lang#123980 ( Add an opt-in to store incoming edges in `VecGraph` + misc) - rust-lang#124019 (Use raw-dylib for Windows synchronization functions) - rust-lang#124110 (Fix negating `f16` and `f128` constants) - rust-lang#124116 (when suggesting RUST_BACKTRACE=1, add a special note for Miri's env var isolation) r? `@ghost` `@rustbot` modify labels: rollup
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. Fixrust-lang#123696.
This bug is now fixed in stable rustc. See rust-lang/rust#123696rust-lang/rust#123752
It was added in rust-lang#123752 to handle some cases involving emoji, but it isn't necessary because it's always treated the same as `TokenKind::InvalidIdent`. This commit removes it, which makes things a little simpler.
Do not accept the following
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#123696.