Skip to content

Commit

Permalink
Auto merge of #118261 - spastorino:fix-placeholder-replacer, r=compil…
Browse files Browse the repository at this point in the history
…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`
  • Loading branch information
bors committed Nov 25, 2023
2 parents a34e2d7 + 2e94f97 commit 9d23e12
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 9d23e12

Please sign in to comment.