Closed
Description
struct S {
a: usize,
b: usize,
}
fn main() {
let s = S { a: 4, b: 2 };
let S {a , ref b: _ } = s;
}
produces the following error:
error: expected `,`
--> src/main.rs:8:20
|
8 | let S {a , ref b: _ } = s;
| ^
error[E0027]: pattern does not mention fields `a`, `b`
--> src/main.rs:8:9
|
8 | let S {a , ref b: _ } = s;
| ^^^^^^^^^^^^^^^^^ missing fields `a`, `b`
It shouldn't complain about the missing fields.