]> git.lizzy.rs Git - rust.git/blob - src/test/ui/destructuring-assignment/nested_destructure.rs
Rollup merge of #105758 - Nilstrieb:typeck-results-mod, r=compiler-errors
[rust.git] / src / test / ui / destructuring-assignment / nested_destructure.rs
1 // run-pass
2
3 struct Struct<S, T> {
4     a: S,
5     b: T,
6 }
7
8 struct TupleStruct<S, T>(S, T);
9
10 fn main() {
11     let (a, b, c, d);
12     Struct { a: TupleStruct((a, b), c), b: [d] } =
13         Struct { a: TupleStruct((0, 1), 2), b: [3] };
14     assert_eq!((a, b, c, d), (0, 1, 2, 3));
15
16     // unnested underscore: just discard
17     _ = 1;
18 }