Do not erase late bound regions when selecting inherent associated types by spastorino · Pull Request #118118 · rust-lang/rust

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Nov 21, 2023

compiler-errors

@compiler-errors compiler-errors changed the title Do not erase late bound regions on iat Do not erase late bound regions when selecting inherent associated types

Nov 21, 2023

lcnr

fmease added a commit to fmease/rust that referenced this pull request

Nov 25, 2023
…=compiler-errors

Relate Inherent Associated Types using eq

We should call `eq` instead of `sup` as we're relating `Ty` directly and not `Binder<TraitRef>`.

This is part of rust-lang#118118 but unrelated to that PR.

r? `@compiler-errors` `@lcnr`

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Nov 25, 2023
Rollup merge of rust-lang#118262 - spastorino:relate-iats-using-eq, r=compiler-errors

Relate Inherent Associated Types using eq

We should call `eq` instead of `sup` as we're relating `Ty` directly and not `Binder<TraitRef>`.

This is part of rust-lang#118118 but unrelated to that PR.

r? `@compiler-errors` `@lcnr`

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Nov 25, 2023
Rollup merge of rust-lang#118259 - spastorino:move-eager-resolver-to-infer, r=compiler-errors

Move EagerResolution to rustc_infer::infer::resolve

`EagerResolver` fits better in `rustc_infer::infer::resolver`.

Started to disentagle rust-lang#118118 that has a lot of unrelated things.

r? `@compiler-errors` `@lcnr`

bors added a commit to rust-lang/miri that referenced this pull request

Nov 25, 2023
…er-errors

Make PlaceholderReplacer shallow_resolver and recur when infer vars

This makes resolve type and const infer vars resolve.

Given:

```rust
#![feature(inherent_associated_types)]
#![allow(incomplete_features)]

struct Foo<T>(T);

impl<'a> Foo<fn(&'a ())> {
    type Assoc = &'a ();
}

fn bar(_: for<'a> fn(Foo<fn(Foo<fn(&'static ())>::Assoc)>::Assoc)) {}

fn main() {}
```

We should normalize `for<'a> fn(Foo<fn(Foo<fn(&'static ())>::Assoc)>::Assoc)` to `for<'0> fn(&'1 ())` with `'1 == '0` and `'0 == 'static` constraints. We have to resolve `'1` to `'static` in the infcx associated to `PlaceholderReplacer`.

This is part of rust-lang/rust#118118 but unrelated to that PR.

r? `@compiler-errors` `@lcnr`

@spastorino

@spastorino

compiler-errors

@spastorino

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Nov 27, 2023

bors added a commit to rust-lang-ci/rust that referenced this pull request

Nov 28, 2023
…r=<try>

Fix for TypeId exposes equality-by-subtyping vs normal-form-syntactic-equality unsoundness

Fixes rust-lang#97156

This PR revives rust-lang#97427 idea, it sits on top of rust-lang#118118 because the idea uncovered some problems with IATs.

r? `@lcnr`

This is ICEing yet for `tests/ui/traits/new-solver/escaping-bound-vars-in-writeback-normalization.rs` using the new trait solver.
After rust-lang#118118 and this ICE is fixed, we would need a rebase and a crater run.

Opening as a WIP for now.