summaryrefslogtreecommitdiffstats
path: root/src/test/ui/type-inference/unbounded-associated-type.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/type-inference/unbounded-associated-type.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/type-inference/unbounded-associated-type.rs b/src/test/ui/type-inference/unbounded-associated-type.rs
new file mode 100644
index 000000000..0167e9436
--- /dev/null
+++ b/src/test/ui/type-inference/unbounded-associated-type.rs
@@ -0,0 +1,16 @@
+trait T {
+ type A;
+ fn foo(&self) -> Self::A {
+ panic!()
+ }
+}
+
+struct S<X>(std::marker::PhantomData<X>);
+
+impl<X> T for S<X> {
+ type A = X;
+}
+
+fn main() {
+ S(std::marker::PhantomData).foo(); //~ ERROR type annotations needed
+}