about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-12-03 19:08:00 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2022-12-03 19:08:00 +0000
commit8a7ae23f75953cfb9ba1e07cc37be8455ac979c3 (patch)
treeedc0abdb1db47d59ac68ac058581314893c9a303 /src/test
parentcab4fd678c5b148a330f2bf255bf28a67dfea0fc (diff)
downloadrust-8a7ae23f75953cfb9ba1e07cc37be8455ac979c3.tar.gz
rust-8a7ae23f75953cfb9ba1e07cc37be8455ac979c3.zip
Properly substitute inherent associated types.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/associated-inherent-types/struct-generics.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/associated-inherent-types/struct-generics.rs b/src/test/ui/associated-inherent-types/struct-generics.rs
new file mode 100644
index 00000000000..8952b379173
--- /dev/null
+++ b/src/test/ui/associated-inherent-types/struct-generics.rs
@@ -0,0 +1,15 @@
+// check-pass
+
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+struct S<T>(T);
+
+impl<T> S<T> {
+    type P = T;
+}
+
+fn main() {
+    type A = S<()>::P;
+    let _: A = ();
+}