rust/tests/ui/traits/new-solver
Matthias Krüger 44db7c3b5a
Rollup merge of #110180 - lcnr:canonicalize, r=compiler-errors
don't uniquify regions when canonicalizing

uniquifying causes a bunch of issues, most notably it causes `AliasEq(<?x as Trait<'a>>::Assoc, <?x as Trait<'a>>::Assoc)` to result in ambiguity because both `normalizes-to` paths result in ambiguity and substs equate should trivially succeed but doesn't because we uniquified `'a` to two different regions.

I originally added uniquification to make it easier to deal with requirement 6 from the dev-guide: https://rustc-dev-guide.rust-lang.org/solve/trait-solving.html#requirements

> ### 6. Trait solving must be (free) lifetime agnostic
>
> Trait solving during codegen should have the same result as during typeck. As we erase
> all free regions during codegen we must not rely on them during typeck. A noteworthy example
> is special behavior for `'static`.

cc https://github.com/rust-lang/rustc-dev-guide/pull/1671

Relying on regions being identical may cause ICE during MIR typeck, but even without this PR we can end up relying on that as type inference vars can resolve to types which contain an identical region. Let's land this and deal with any ICE that crop up as we go. Will look at this issue again before stabilization.

r? ```@compiler-errors```
2023-04-14 07:58:40 +02:00
..
coherence
alias_eq_cant_be_furthur_normalized.rs
alias_eq_dont_use_normalizes_to_if_substs_eq.rs prioritize param-env candidates 2023-04-10 09:16:33 +02:00
alias_eq_dont_use_normalizes_to_if_substs_eq.stderr
alias_eq_simple.rs
alias_eq_substs_eq_not_intercrate.rs
alias_eq_substs_eq_not_intercrate.stderr
alias-eq-in-canonical-response.rs
alias-sub.rs
async.fail.stderr
async.rs
auto-with-drop_tracking_mir.fail.stderr
auto-with-drop_tracking_mir.rs
builtin-fn-must-return-sized.rs
builtin-fn-must-return-sized.stderr
canonical-int-var-eq-in-response.rs
canonical-ty-var-eq-in-response.rs
cast-checks-handling-projections.rs
closure-inference-guidance.rs
const-param-placeholder.fail.stderr
const-param-placeholder.rs
deduce-ty-from-object.rs
destruct.rs
dont-elaborate-for-projections.rs
elaborate-item-bounds.rs
equating-projection-cyclically.rs
equating-projection-cyclically.stderr
float-canonical.rs
fn-trait-closure.rs
fn-trait.rs
fn-trait.stderr
generator.fail.stderr
generator.rs
higher-ranked-dyn-bounds.rs
int-var-alias-eq.rs
int-var-is-send.rs Stall auto-trait assembly for int/float vars in new solver 2023-04-10 15:54:14 +00:00
iter-filter-projection.rs Add test for uniquifying regions 2023-04-14 03:22:12 +00:00
lazy-nested-obligations-1.rs
lazy-nested-obligations-2.rs
lazy-nested-obligations-3.rs
more-object-bound.rs
more-object-bound.stderr
nested-obligations-with-bound-vars-gat.rs
normalize-param-env-1.rs
normalize-param-env-2.rs
normalize-param-env-3.rs
normalizes_to_ignores_unnormalizable_candidate.rs
normalizes_to_ignores_unnormalizable_candidate.self_infer.stderr
object-unsafety.rs
object-unsafety.stderr
param-candidate-doesnt-shadow-project.rs
param-discr-kind.rs
pointee.rs
pointer-like.rs Enforce that PointerLike requires a pointer-like ABI 2023-04-08 21:11:16 +00:00
pointer-like.stderr Enforce that PointerLike requires a pointer-like ABI 2023-04-08 21:11:16 +00:00
prefer-candidate-no-constraints.rs prioritize param-env candidates 2023-04-10 09:16:33 +02:00
prefer-param-env-on-ambiguity.rs prioritize param-env candidates 2023-04-10 09:16:33 +02:00
projection-discr-kind.rs
projection-discr-kind.stderr
provisional-result-done.rs
recursive-self-normalization-2.rs Report overflows gracefully with new solver 2023-04-10 16:36:30 +00:00
recursive-self-normalization-2.stderr Report overflows gracefully with new solver 2023-04-10 16:36:30 +00:00
recursive-self-normalization.rs Report overflows gracefully with new solver 2023-04-10 16:36:30 +00:00
recursive-self-normalization.stderr Report overflows gracefully with new solver 2023-04-10 16:36:30 +00:00
runaway-impl-candidate-selection.rs
runaway-impl-candidate-selection.stderr
specialization-transmute.rs
specialization-transmute.stderr
specialization-unconstrained.rs
specialization-unconstrained.stderr
stall-num-var-auto-trait.fallback.stderr Stall auto-trait assembly for int/float vars in new solver 2023-04-10 15:54:14 +00:00
stall-num-var-auto-trait.rs Stall auto-trait assembly for int/float vars in new solver 2023-04-10 15:54:14 +00:00
temporary-ambiguity.rs
try-example.rs
two-projection-param-candidates-are-ambiguous.rs
two-projection-param-candidates-are-ambiguous.stderr
unsafe-auto-trait-impl.rs
unsize-good.rs
upcast-right-substs.rs
upcast-wrong-substs.rs
upcast-wrong-substs.stderr