summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-types/associated-types-eq-expr-path.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/associated-types/associated-types-eq-expr-path.rs')
-rw-r--r--src/test/ui/associated-types/associated-types-eq-expr-path.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/associated-types/associated-types-eq-expr-path.rs b/src/test/ui/associated-types/associated-types-eq-expr-path.rs
new file mode 100644
index 000000000..143992f29
--- /dev/null
+++ b/src/test/ui/associated-types/associated-types-eq-expr-path.rs
@@ -0,0 +1,16 @@
+// Check that an associated type cannot be bound in an expression path.
+
+trait Foo {
+ type A;
+ fn bar() -> isize;
+}
+
+impl Foo for isize {
+ type A = usize;
+ fn bar() -> isize { 42 }
+}
+
+pub fn main() {
+ let x: isize = Foo::<A=usize>::bar();
+ //~^ ERROR associated type bindings are not allowed here
+}