rust/compiler/rustc_trait_selection
bors b2e73e9aad Auto merge of #118261 - spastorino:fix-placeholder-replacer, r=compiler-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 https://github.com/rust-lang/rust/pull/118118 but unrelated to that PR.

r? `@compiler-errors` `@lcnr`
2023-11-25 05:10:10 +00:00
..
src Auto merge of #118261 - spastorino:fix-placeholder-replacer, r=compiler-errors 2023-11-25 05:10:10 +00:00
Cargo.toml Replace custom_encodable with encodable. 2023-11-22 18:37:14 +11:00
messages.ftl Add some additional warnings for duplicated diagnostic items 2023-11-17 07:28:43 +01:00