]> git.lizzy.rs Git - rust.git/blob - tests/ui/associated-types/associated-type-struct-construction.rs
Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco
[rust.git] / tests / ui / associated-types / associated-type-struct-construction.rs
1 // Make sure that users can construct structs through associated types
2 // in both expressions and patterns
3
4 #![feature(more_qualified_paths)]
5
6 // check-pass
7 fn main() {
8     let <Foo as A>::Assoc { br } = <Foo as A>::Assoc { br: 2 };
9     assert!(br == 2);
10 }
11
12 struct StructStruct {
13     br: i8,
14 }
15
16 struct Foo;
17
18 trait A {
19     type Assoc;
20 }
21
22 impl A for Foo {
23     type Assoc = StructStruct;
24 }