You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #141754 - jhpratt:restrictions-pr1, r=<try>
Introduce `impl` restrictions to AST, lower to `rustc_middle`
RFC approved in [RFC 3323](https://rust-lang.github.io/rfcs/3323-restrictions.html); part of tracking issue #105077 and a [2025H1 project goal](rust-lang/rust-project-goals#257).
This is likely easiest to review commit-by-commit.
First, the `impl` restriction is introduced to the AST, followed by actually parsing it into the AST on trait definitions (the only place it's permitted). Next we add the ability for `rustfmt` to handle it in the most logical manner; unstable features are permitted to choose a sane format without a team decision. After placing it behind a feature gate, the restriction is lowered to `rustc_middle` with identical limitations to visibility. Finally, the diagnostics are partially moved into Fluent to make them a bit more translatable.
This is the groundwork for the restriction and does not actually enforce anything; that is coming in another PR soon.
r? `@Urgau` as discussed
0 commit comments