-
Notifications
You must be signed in to change notification settings - Fork 13.3k
norm nested aliases before evaluating the parent goal #140236
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
Conversation
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
af161c3
to
ba259b9
Compare
@@ -137,6 +136,7 @@ impl<'tcx> Predicate<'tcx> { | |||
| PredicateKind::Coerce(_) | |||
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(_)) | |||
| PredicateKind::ConstEquate(_, _) | |||
| PredicateKind::NormalizesTo(..) | |||
| PredicateKind::Ambiguous => true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're actually free to normalize NormalizesTo
goals. The alias we're normalizing is already an AliasTerm
so we only ever normalize the arguments, not the alias itself.
We actually already did this before this PR because we directly folded a Goal<I, NormalizesTo<I>>
for NormalizesTo
goals.
We could in theory also normalize the arguments of aliases in AliasRelate
. However, setting allow_normalization
to true
for this would cause us to also attempt to normalize the aliases we're actually relating. Given that we use AliasRelate
to do so, that would result in a trivial cycle.
ba259b9
to
02e3491
Compare
[DO NOT MERGE] bootstrap with `-Znext-solver=globally` A revival of rust-lang#124812. Current status: ~~`./x.py b --stage 2` passes 🎉~~ `try` builds succeed 🎉 🎉 🎉 ~~[top 100 most downloaded crates on crates.io compile](rust-lang#133502 (comment) [top 1000 most downloaded crates on crates.io compile](rust-lang#133502 (comment)) [first perf run](rust-lang#133502 (comment)) 👻 ### in-flight changes - rust-lang#124852, unsure whether I actually want to land this PR for now - rust-lang#140236 - rust-lang#139587 - https://github.com/lcnr/rust/tree/opaque-type-method-call - normalize when checking whether param env candidates are global - double the available recursion depth in the new solver ☠️ r? `@ghost`
@bors r+ |
@bors r- |
02e3491
to
e5e3a95
Compare
@bors r=compiler-errors rollup |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#137653 (Deprecate the unstable `concat_idents!`) - rust-lang#138957 (Update the index of Option to make the summary more comprehensive) - rust-lang#140006 (ensure compiler existance of tools on the dist step) - rust-lang#140143 (Move `sys::pal::os::Env` into `sys::env`) - rust-lang#140202 (Make #![feature(let_chains)] bootstrap conditional in compiler/) - rust-lang#140236 (norm nested aliases before evaluating the parent goal) - rust-lang#140257 (Some drive-by housecleaning in `rustc_borrowck`) - rust-lang#140278 (Don't use item name to look up associated item from trait item) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#140236 - lcnr:normalizes-to-goals, r=compiler-errors norm nested aliases before evaluating the parent goal see the explanation of the underlying issue in tests/ui/traits/next-solver/normalize/eager-norm-pre-normalizes-to.rs. This is also the cause of rust-lang/trait-system-refactor-initiative#184, fixing the overflow errors with the new solver. I did not add any tests based on it directly as relying on that behavior to cause recursion limit shenanigans feels fragile. Thanks `@Nadrieril` for minimizing the issue [on zulip](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/typenum.20.602.20.2F.201.60.20overflow.20error/with/513993621). r? `@compiler-errors`
see the explanation of the underlying issue in tests/ui/traits/next-solver/normalize/eager-norm-pre-normalizes-to.rs.
This is also the cause of rust-lang/trait-system-refactor-initiative#184, fixing the overflow errors with the new solver. I did not add any tests based on it directly as relying on that behavior to cause recursion limit shenanigans feels fragile. Thanks @Nadrieril for minimizing the issue on zulip.
r? @compiler-errors