-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Breaking change in macro_rules ty fragment parsing in version 1.68 #107796
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
searched nightlies: from nightly-2022-06-01 to nightly-2023-02-01 bisected with cargo-bisect-rustc v0.6.4Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --access github --timeout 30 --start 2022-06-01 --end 2023-02-01 --regress error I think I see where the issue is, I'll fix it. @rustbot claim |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high |
…macro-is-ok, r=estebank Do not eagerly recover for bad `impl Trait` types in macros Fixes rust-lang#107796 cc rust-lang#106712, `@estebank` and `@Ezrashaw` please make sure to use [`Parser::may_recover`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/parser/struct.Parser.html#method.may_recover) for all eager-token-consuming parser recoveries. This also fixes a separate regression from rust-lang#99915, that was introduced before we added `may_recover` though.
…macro-is-ok, r=estebank Do not eagerly recover for bad `impl Trait` types in macros Fixes rust-lang#107796 cc rust-lang#106712, ``@estebank`` and ``@Ezrashaw`` please make sure to use [`Parser::may_recover`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/parser/struct.Parser.html#method.may_recover) for all eager-token-consuming parser recoveries. This also fixes a separate regression from rust-lang#99915, that was introduced before we added `may_recover` though.
IIRC issues with a backport pending should stay open to track the backport process (not 100% sure tho) |
beta backport in #108037 |
Uh oh!
There was an error while loading. Please reload this page.
I tried this code:
link to playground
I expected to see this happen:
Macro is expanded to
fn a(_: u8) {}
Instead, this happened:
On stable
1.67
it works as expected.On beta
1.68
and nightly1.69
it fails with the following errorIt is probably caused by
ty
fragment that now treatsimpl
as a start ofimpl Trait
type.So makes sense. But breaks existing code :)
The text was updated successfully, but these errors were encountered: