rust/compiler/rustc_trait_selection/src/solve
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
..
assembly Auto merge of #107614 - compiler-errors:allow-elaborator-to-filter-only-super-traits, r=oli-obk 2023-04-12 08:39:19 +00:00
eval_ctxt Fix typos in compiler 2023-04-10 22:02:52 +02:00
search_graph Fix typos in compiler 2023-04-10 22:02:52 +02:00
canonicalize.rs Rollup merge of #110180 - lcnr:canonicalize, r=compiler-errors 2023-04-14 07:58:40 +02:00
eval_ctxt.rs Support safe transmute in new solver 2023-04-10 16:08:14 +00:00
fulfill.rs Report overflows gracefully with new solver 2023-04-10 16:36:30 +00:00
mod.rs review + some small stuff 2023-04-10 09:21:21 +02:00
project_goals.rs Support safe transmute in new solver 2023-04-10 16:08:14 +00:00
trait_goals.rs Rollup merge of #110126 - compiler-errors:new-solver-safe-transmute, r=oli-obk 2023-04-11 20:28:48 -07:00