]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/associated-types-unconstrained.rs
feat(rustdoc): open sidebar menu when links inside it are focused
[rust.git] / src / test / ui / associated-types / associated-types-unconstrained.rs
1 // Check that an associated type cannot be bound in an expression path.
2
3 trait Foo {
4     type A;
5     fn bar() -> isize;
6 }
7
8 impl Foo for isize {
9     type A = usize;
10     fn bar() -> isize { 42 }
11 }
12
13 pub fn main() {
14     let x: isize = Foo::bar();
15     //~^ ERROR type annotations needed
16 }