diff options
Diffstat (limited to 'src/test/ui/associated-types/associated-types-unconstrained.rs')
-rw-r--r-- | src/test/ui/associated-types/associated-types-unconstrained.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/associated-types/associated-types-unconstrained.rs b/src/test/ui/associated-types/associated-types-unconstrained.rs new file mode 100644 index 000000000..2fb27bf3c --- /dev/null +++ b/src/test/ui/associated-types/associated-types-unconstrained.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::bar(); + //~^ ERROR E0790 +} |