summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-types/associated-types-eq-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/associated-types/associated-types-eq-2.rs')
-rw-r--r--src/test/ui/associated-types/associated-types-eq-2.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/associated-types/associated-types-eq-2.rs b/src/test/ui/associated-types/associated-types-eq-2.rs
new file mode 100644
index 000000000..18e38d446
--- /dev/null
+++ b/src/test/ui/associated-types/associated-types-eq-2.rs
@@ -0,0 +1,19 @@
+// Test equality constraints on associated types. Check we get an error when an
+// equality constraint is used in a qualified path.
+
+pub trait Foo {
+ type A;
+ fn boo(&self) -> <Self as Foo>::A;
+}
+
+struct Bar;
+
+impl Foo for isize {
+ type A = usize;
+ fn boo(&self) -> usize { 42 }
+}
+
+fn baz<I: Foo>(x: &<I as Foo<A=Bar>>::A) {}
+//~^ ERROR associated type bindings are not allowed here
+
+pub fn main() {}