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 new solver cleanup + coherence 2023-03-21 16:27:25 +01:00
alias-eq-in-canonical-response.rs Return nested obligations from canonical response var unification 2023-03-23 19:00:04 +00:00
alias-sub.rs Include relation direction in AliasEq predicate 2023-03-23 05:56:27 +00:00
alias_eq_cant_be_furthur_normalized.rs Add tests 2023-02-10 14:56:28 +00:00
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 Add tests 2023-02-10 14:56:28 +00:00
alias_eq_simple.rs Add tests 2023-02-10 14:56:28 +00:00
alias_eq_substs_eq_not_intercrate.rs Add tests 2023-02-10 14:56:28 +00:00
alias_eq_substs_eq_not_intercrate.stderr Add tests 2023-02-10 14:56:28 +00:00
async.fail.stderr Implement Generator and Future 2023-01-26 03:15:36 +00:00
async.rs Implement Generator and Future 2023-01-26 03:15:36 +00:00
auto-with-drop_tracking_mir.fail.stderr Implement support for GeneratorWitnessMIR in new solver 2023-04-05 03:04:54 +00:00
auto-with-drop_tracking_mir.rs Implement support for GeneratorWitnessMIR in new solver 2023-04-05 03:04:54 +00:00
builtin-fn-must-return-sized.rs Check that built-in callable types validate their output type is Sized (in new solver) 2023-02-18 19:32:58 +00:00
builtin-fn-must-return-sized.stderr Check that built-in callable types validate their output type is Sized (in new solver) 2023-02-18 19:32:58 +00:00
canonical-int-var-eq-in-response.rs Drive-by: Add -Ztrait-solver=next to canonical int var test 2023-03-22 18:26:33 +00:00
canonical-ty-var-eq-in-response.rs Canonicalize the ROOT VAR 2023-03-07 17:11:35 +00:00
cast-checks-handling-projections.rs Commit some tests for the new solver + lazy norm 2023-03-11 23:16:46 +00:00
closure-inference-guidance.rs Closures always implement FnOnce in new solver 2023-03-30 15:11:42 +00:00
const-param-placeholder.fail.stderr Don't ICE on placeholder consts in deep reject 2023-03-29 23:28:44 +00:00
const-param-placeholder.rs Don't ICE on placeholder consts in deep reject 2023-03-29 23:28:44 +00:00
deduce-ty-from-object.rs Canonicalize the ROOT VAR 2023-03-07 17:11:35 +00:00
destruct.rs Implement non-const Destruct trait in new solver 2023-03-22 18:22:27 +00:00
dont-elaborate-for-projections.rs Do not consider elaborated projection predicates for objects in new solver 2023-03-29 16:13:05 +00:00
elaborate-item-bounds.rs Use elaborated item bounds for alias types 2023-02-09 17:16:47 +00:00
equating-projection-cyclically.rs Commit some tests for the new solver + lazy norm 2023-03-11 23:16:46 +00:00
equating-projection-cyclically.stderr Commit some tests for the new solver + lazy norm 2023-03-11 23:16:46 +00:00
float-canonical.rs canonicalize float var as float in new solver 2023-03-30 01:15:37 +00:00
fn-trait-closure.rs fn-trait-closure test now pass on new solver 2023-01-22 12:36:58 -03:00
fn-trait.rs Also check function items' signatures for Fn* trait compatibility 2023-03-21 11:50:14 +00:00
fn-trait.stderr Also check function items' signatures for Fn* trait compatibility 2023-03-21 11:50:14 +00:00
generator.fail.stderr Implement Generator and Future 2023-01-26 03:15:36 +00:00
generator.rs Implement Generator and Future 2023-01-26 03:15:36 +00:00
higher-ranked-dyn-bounds.rs Make higher-ranked projections in object types work in new solver 2023-02-24 02:48:44 +00:00
int-var-alias-eq.rs Emit alias-eq when equating numeric var and projection 2023-03-09 16:42:56 +00:00
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 Commit some tests for the new solver + lazy norm 2023-03-11 23:16:46 +00:00
lazy-nested-obligations-2.rs Commit some tests for the new solver + lazy norm 2023-03-11 23:16:46 +00:00
lazy-nested-obligations-3.rs Commit some tests for the new solver + lazy norm 2023-03-11 23:16:46 +00:00
more-object-bound.rs Do not consider elaborated projection predicates for objects in new solver 2023-03-29 16:13:05 +00:00
more-object-bound.stderr Do not consider elaborated projection predicates for objects in new solver 2023-03-29 16:13:05 +00:00
nested-obligations-with-bound-vars-gat.rs Add a test that used to take forever to compile 2023-03-13 16:34:16 +00:00
normalize-param-env-1.rs Commit some tests for the new solver + lazy norm 2023-03-11 23:16:46 +00:00
normalize-param-env-2.rs Commit some tests for the new solver + lazy norm 2023-03-11 23:16:46 +00:00
normalize-param-env-3.rs Commit some tests for the new solver + lazy norm 2023-03-11 23:16:46 +00:00
normalizes_to_ignores_unnormalizable_candidate.rs Add tests 2023-02-10 14:56:28 +00:00
normalizes_to_ignores_unnormalizable_candidate.self_infer.stderr Add tests 2023-02-10 14:56:28 +00:00
object-unsafety.rs Check object's supertrait and associated type bounds in new solver 2023-02-24 02:45:05 +00:00
object-unsafety.stderr Check object's supertrait and associated type bounds in new solver 2023-02-24 02:45:05 +00:00
param-candidate-doesnt-shadow-project.rs Add a couple random projection tests 2023-02-10 18:14:09 +00:00
param-discr-kind.rs Don't ICE on DiscriminantKind projection in new solver 2023-03-30 00:53:16 +00:00
pointee.rs Check pointee metadata correctly in ui test 2023-03-30 00:53:17 +00:00
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 Don't ICE on DiscriminantKind projection in new solver 2023-03-30 00:53:16 +00:00
projection-discr-kind.stderr Don't ICE on DiscriminantKind projection in new solver 2023-03-30 00:53:16 +00:00
provisional-result-done.rs Multiple candidates with same response is not ambiguous 2023-02-10 00:35:25 +00:00
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 Treat projections with infer as placeholder during fast reject in new solver 2023-03-13 16:34:16 +00:00
runaway-impl-candidate-selection.stderr Treat projections with infer as placeholder during fast reject in new solver 2023-03-13 16:34:16 +00:00
specialization-transmute.rs transmute test 2023-03-26 00:03:14 +00:00
specialization-transmute.stderr transmute test 2023-03-26 00:03:14 +00:00
specialization-unconstrained.rs Still-further-specializable projections are ambiguous 2023-03-25 23:51:08 +00:00
specialization-unconstrained.stderr Still-further-specializable projections are ambiguous 2023-03-25 23:51:08 +00:00
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 Implement a dummy drop-in-favor-of for the new solver 2023-02-09 17:22:37 +00:00
try-example.rs Commit some new solver tests 2023-02-27 05:23:26 +00:00
two-projection-param-candidates-are-ambiguous.rs Add a couple random projection tests 2023-02-10 18:14:09 +00:00
two-projection-param-candidates-are-ambiguous.stderr Add a couple random projection tests 2023-02-10 18:14:09 +00:00
unsafe-auto-trait-impl.rs Disqualify auto-trait builtin impl in new solver if impl exists 2023-02-09 17:23:50 +00:00
unsize-good.rs Implement unsizing in the new trait solver 2023-01-30 19:11:01 +00:00
upcast-right-substs.rs Trait upcasting support in new solver 2023-01-30 19:11:01 +00:00
upcast-wrong-substs.rs Trait upcasting support in new solver 2023-01-30 19:11:01 +00:00
upcast-wrong-substs.stderr Trait upcasting support in new solver 2023-01-30 19:11:01 +00:00