This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit b2e73e9
committed
Auto merge of rust-lang#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 rust-lang#118118 but unrelated to that PR.
r? `@compiler-errors` `@lcnr`1 file changed
+18
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1001 | 1001 | | |
1002 | 1002 | | |
1003 | 1003 | | |
1004 | | - | |
| 1004 | + | |
1005 | 1005 | | |
1006 | 1006 | | |
1007 | 1007 | | |
| |||
1048 | 1048 | | |
1049 | 1049 | | |
1050 | 1050 | | |
| 1051 | + | |
1051 | 1052 | | |
1052 | 1053 | | |
1053 | 1054 | | |
| |||
1063 | 1064 | | |
1064 | 1065 | | |
1065 | 1066 | | |
1066 | | - | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
1067 | 1074 | | |
1068 | 1075 | | |
1069 | 1076 | | |
1070 | | - | |
| 1077 | + | |
1071 | 1078 | | |
1072 | 1079 | | |
1073 | 1080 | | |
1074 | 1081 | | |
1075 | 1082 | | |
| 1083 | + | |
1076 | 1084 | | |
1077 | 1085 | | |
1078 | 1086 | | |
| |||
1087 | 1095 | | |
1088 | 1096 | | |
1089 | 1097 | | |
1090 | | - | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
1091 | 1105 | | |
1092 | 1106 | | |
1093 | 1107 | | |
| |||
0 commit comments