summaryrefslogtreecommitdiffstats
path: root/tests/ui/associated-item/ambiguous-associated-type-with-generics.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/associated-item/ambiguous-associated-type-with-generics.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/associated-item/ambiguous-associated-type-with-generics.rs b/tests/ui/associated-item/ambiguous-associated-type-with-generics.rs
new file mode 100644
index 000000000..9c26e339a
--- /dev/null
+++ b/tests/ui/associated-item/ambiguous-associated-type-with-generics.rs
@@ -0,0 +1,14 @@
+// run-rustfix
+trait Trait<A> {}
+
+trait Assoc {
+ type Ty;
+}
+
+impl<A> Assoc for dyn Trait<A> {
+ type Ty = i32;
+}
+
+fn main() {
+ let _x: <dyn Trait<i32>>::Ty; //~ ERROR ambiguous associated type
+}