about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-04-14 07:58:40 +0200
committerGitHub <noreply@github.com>2023-04-14 07:58:40 +0200
commit44db7c3b5af658370e5e55d8b7f6338cce225538 (patch)
tree344d4300eef7300b52f7a4b8057c21d54ed9e06a /compiler/rustc_codegen_llvm/src/errors.rs
parent2e39e15e40d988f5d412b67dc1c2338aeb53a384 (diff)
parentc68c6c3942d8c3aab4d9e9406a0a4473218f8cea (diff)
downloadrust-44db7c3b5af658370e5e55d8b7f6338cce225538.tar.gz
rust-44db7c3b5af658370e5e55d8b7f6338cce225538.zip
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```
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions