Rollup merge of #105315 - fmease:norm-subst-iat, r=compiler-errors

Normalize inherent associated types after substitution

Fixes #105314.

r? ````@cjgillot```` (#105224)
````@rustbot```` label F-inherent_associated_types
This commit is contained in:
Yuki Okushi 2022-12-06 12:48:53 +09:00 committed by GitHub
commit 7ba37adbfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 45 additions and 0 deletions

View file

@ -0,0 +1,22 @@
// check-pass
#![feature(inherent_associated_types)]
#![allow(incomplete_features)]
struct S<T>(T);
impl<T: O> S<T> {
type P = <T as O>::P;
}
trait O {
type P;
}
impl O for i32 {
type P = String;
}
fn main() {
let _: S<i32>::P = String::new();
}

View file

@ -0,0 +1,22 @@
// check-pass
#![feature(inherent_associated_types)]
#![allow(incomplete_features)]
struct S;
impl S {
type P<T: O> = <T as O>::P;
}
trait O {
type P;
}
impl O for i32 {
type P = String;
}
fn main() {
let _: S::P<i32> = String::new();
}