about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev+love@gmail.com>2022-12-06 12:48:53 +0900
committerGitHub <noreply@github.com>2022-12-06 12:48:53 +0900
commit7ba37adbfdcbc2ca3ca220938c85400512cace97 (patch)
treed75401f8e8aa93549d584e5726d0b548e36e6728 /src
parenteeb1bbc64103a3c6f47bb31cef051ad122147dfa (diff)
parentd5cb5fb1853952c0e5377e86a09c0fcf5bf2a829 (diff)
downloadrust-7ba37adbfdcbc2ca3ca220938c85400512cace97.tar.gz
rust-7ba37adbfdcbc2ca3ca220938c85400512cace97.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/associated-inherent-types/normalize-projection-0.rs22
-rw-r--r--src/test/ui/associated-inherent-types/normalize-projection-1.rs22
2 files changed, 44 insertions, 0 deletions
diff --git a/src/test/ui/associated-inherent-types/normalize-projection-0.rs b/src/test/ui/associated-inherent-types/normalize-projection-0.rs
new file mode 100644
index 00000000000..50763ecddf9
--- /dev/null
+++ b/src/test/ui/associated-inherent-types/normalize-projection-0.rs
@@ -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();
+}
diff --git a/src/test/ui/associated-inherent-types/normalize-projection-1.rs b/src/test/ui/associated-inherent-types/normalize-projection-1.rs
new file mode 100644
index 00000000000..2f7b2551a03
--- /dev/null
+++ b/src/test/ui/associated-inherent-types/normalize-projection-1.rs
@@ -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();
+}