2020-11-07 08:28:55 -06:00
|
|
|
// run-pass
|
|
|
|
|
|
|
|
struct Struct<S, T> {
|
|
|
|
a: S,
|
|
|
|
b: T,
|
|
|
|
}
|
|
|
|
|
|
|
|
struct TupleStruct<S, T>(S, T);
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let (a, b, c, d);
|
|
|
|
Struct { a: TupleStruct((a, b), c), b: [d] } =
|
|
|
|
Struct { a: TupleStruct((0, 1), 2), b: [3] };
|
|
|
|
assert_eq!((a, b, c, d), (0, 1, 2, 3));
|
2020-11-11 07:15:15 -06:00
|
|
|
|
|
|
|
// unnested underscore: just discard
|
|
|
|
_ = 1;
|
2020-11-07 08:28:55 -06:00
|
|
|
}
|