-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Do not bring trait alias supertraits into scope #107803
Do not bring trait alias supertraits into scope #107803
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
r? compiler |
@rustbot author |
7a8f3ab
to
bf05512
Compare
80b7c07
to
1af7bf1
Compare
@rustbot ready |
1af7bf1
to
38ec810
Compare
Thanks, yeah, I agree that inlining @bors r+ |
Rollup of 6 pull requests Successful merges: - rust-lang#107648 (unused-lifetimes: don't warn about lifetimes originating from expanded code) - rust-lang#107655 (rustdoc: use the same URL escape rules for fragments as for examples) - rust-lang#107659 (test: snapshot for derive suggestion in diff files) - rust-lang#107786 (Implement some tweaks in the new solver) - rust-lang#107803 (Do not bring trait alias supertraits into scope) - rust-lang#107815 (Disqualify `auto trait` built-in impl in new solver if explicit `impl` exists) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Would it be possible to pull this into the current beta? Else a PR that requires it will either have to wait for beta 1.69 on 9 March(?) or else include a workaround that I guess will then be reverted once that beta is released. @rustbot label +beta-nominated |
I don't think this deserves beta nomination, since it changes a nightly-only feature and can be worked around trivially. |
Ah, just saw your comment after I already asked on #t-release Zulip stream. Yeah you're probably right, but I thought I'd ask anyway. Thanks! |
Actually there is a deeper problem. This PR affects which imports must be brought into scope, or that end up unused if brought into scope unnecessarily. Hence if a commit that is so affected (such as the interim workaround for my WIP) is accepted into master, CI will cease working as soon as the stage0 compiler incorporates this PR. Getting this into stage0 asap (before any conflicting PRs are accepted) will avoid that. |
I'd need a motivating example to understand what you mean. My first instinct is that changes that require different code when compiled against beta vs nightly like this are typically worked around with |
One motivating example (my WIP contains many similar): using nightly, I wasn't aware of |
Of course even if I use |
@eggyal, in that case, their PRs will fail to build in CI on stage2 (which essentially emulates a build against a promoted beta), and they'll be notified of the failure. I don't think that many PRs will land that import |
Understood. FWIW, it isn't just an import of |
Yes, but also there are basically no users of trait aliases in the compiler except for the one that you plan on introducing. I know it's tough to work around subtle differences between the bootstrap compiler and nightly, but that's just part of working on the compiler, especially when using unstable features like this. |
Only required until fix rust-lang#107803 is merged into stage0 compiler, expected when beta 1.69.0 is released on 2023-03-09, then this commit can be reverted.
…e_lib_with_trait_alias, r=oli-obk Move folding & visiting traits into type library This is a rework of rust-lang#107712, following feedback on that PR. In particular, this version uses trait aliases to reduce the API churn for trait consumers. Doing so requires a workaround for rust-lang#107747 until its fix in rust-lang#107803 is merged into the stage0 compiler; this workaround, which uses conditional compilation based on the `bootstrap` configuration predicate, sits in dedicated commit b409329 for ease of reversion. The possibility of the `rustc_middle` crate retaining its own distinct versions of each folding/visiting trait, blanket-implemented on all types that implement the respective trait in the type library, was also explored: however since this would necessitate making each `rustc_middle` trait a subtrait of the respective type library trait (so that such blanket implementations can delegate their generic methods), no benefit would be gained. r? types
…e_lib_with_trait_alias, r=oli-obk Move folding & visiting traits into type library This is a rework of rust-lang#107712, following feedback on that PR. In particular, this version uses trait aliases to reduce the API churn for trait consumers. Doing so requires a workaround for rust-lang#107747 until its fix in rust-lang#107803 is merged into the stage0 compiler; this workaround, which uses conditional compilation based on the `bootstrap` configuration predicate, sits in dedicated commit b409329 for ease of reversion. The possibility of the `rustc_middle` crate retaining its own distinct versions of each folding/visiting trait, blanket-implemented on all types that implement the respective trait in the type library, was also explored: however since this would necessitate making each `rustc_middle` trait a subtrait of the respective type library trait (so that such blanket implementations can delegate their generic methods), no benefit would be gained. r? types
Fixes #107747
cc #41517