]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/associated-type-tuple-struct-construction.rs
feat(rustdoc): open sidebar menu when links inside it are focused
[rust.git] / src / test / ui / associated-types / associated-type-tuple-struct-construction.rs
1 // Users cannot yet construct structs through associated types
2 // in both expressions and patterns
3
4 #![feature(more_qualified_paths)]
5
6 fn main() {
7     let <Foo as A>::Assoc(n) = <Foo as A>::Assoc(2);
8     //~^ ERROR expected method or associated constant, found associated type
9     //~| ERROR expected method or associated constant, found associated type
10     assert!(n == 2);
11 }
12
13 struct TupleStruct(i8);
14
15 struct Foo;
16
17
18 trait A {
19     type Assoc;
20 }
21
22 impl A for Foo {
23     type Assoc = TupleStruct;
24 }