Deeply normalize obligations in BestObligation folder#139564
Deeply normalize obligations in BestObligation folder#139564bors merged 2 commits intorust-lang:masterfrom
BestObligation folder#139564Conversation
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
| @@ -1,17 +1,9 @@ | |||
| error[E0271]: type mismatch resolving `<dyn Trait<A = A, B = B> as SuperTrait>::A == B` | |||
| error[E0271]: type mismatch resolving `A == B` | |||
There was a problem hiding this comment.
AliasRelate goals are negatively affected by this PR, which should make sense b/c we're normalizing the LHS and RHS; we probably should special-case ProjectionPredicates, since handling AliasRelate predicates is already kinda weird:
rust/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs
Lines 1422 to 1465 in d4f880f
There was a problem hiding this comment.
hmm yeah, I feel like we should do the "alias-relate -> normalization failure" transformation in the BestObligation visitor instead maybe 🤔
This is definitely worse... also in the next-solver/async.rs#fail test
There was a problem hiding this comment.
I'd rather defer this to a different PR. Right now the regression seems like a logical consequence of this implementation, and I'll play around with a fix for the AliasRelate regression separately.
| .unwrap_or_else(|_: Vec<ScrubbedTraitError<'tcx>>| ty.super_fold_with(self)) | ||
| self.at | ||
| .infcx | ||
| .commit_if_ok(|_| { |
There was a problem hiding this comment.
commit_if_ok b/c we shouldn't apply inference/opaque side-effects if the nested goals don't hold.
|
☔ The latest upstream changes (presumably #139555) made this pull request unmergeable. Please resolve the merge conflicts. |
lcnr
left a comment
There was a problem hiding this comment.
so the idea is to deeply normalize the resulting obligations, but not deeply normalizing the goal we use to recur?
In that case, would it be easier to add a single deeply normalize call on the result of the visitor?
lol, I thought we didn't fold |
ae46b4e to
4192cb6
Compare
|
@bors r+ rollup |
|
☔ The latest upstream changes (presumably #139595) made this pull request unmergeable. Please resolve the merge conflicts. |
4192cb6 to
decd7ec
Compare
|
@bors r=lcnr |
Rollup of 12 pull requests Successful merges: - rust-lang#137447 (add `core::intrinsics::simd::{simd_extract_dyn, simd_insert_dyn}`) - rust-lang#138182 (rustc_target: update x86_win64 to match the documented calling convention for f128) - rust-lang#138682 (Allow drivers to supply a list of extra symbols to intern) - rust-lang#138904 (Test linking and running `no_std` binaries) - rust-lang#138998 (Don't suggest the use of `impl Trait` in closure parameter) - rust-lang#139447 (doc changes: debug assertions -> overflow checks) - rust-lang#139469 (Introduce a `//@ needs-crate-type` compiletest directive) - rust-lang#139564 (Deeply normalize obligations in `BestObligation` folder) - rust-lang#139574 (bootstrap: improve `channel` handling) - rust-lang#139600 (Update `compiler-builtins` to 0.1.153) - rust-lang#139641 (Allow parenthesis around inferred array lengths) - rust-lang#139654 (Improve `AssocItem::descr`.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#139564 - compiler-errors:deeply-norm, r=lcnr Deeply normalize obligations in `BestObligation` folder Built on rust-lang#139513. This establishes a somewhat rough invariant that the `Obligation`'s predicate is always deeply normalized in the folder; when we construct a new obligation we normalize it. Putting this up for discussion since it does affect some goals. r? lcnr
Built on #139513.
This establishes a somewhat rough invariant that the
Obligation's predicate is always deeply normalized in the folder; when we construct a new obligation we normalize it.Putting this up for discussion since it does affect some goals.
r? lcnr