Closed
Description
On rustc 1.17:
struct Foo {
one: i32,
two: i32,
three: i32,
}
impl Default for Foo {
fn default() -> Self {
Foo { one : 1, two: 2, three: 3 }
}
}
fn main() {
// this works
let foo = Foo {
one: 11,
..Foo::default()
};
// this is a syntax error
let foo = Foo {
one: 111,
..Foo::default(),
};
}
(playground link: https://is.gd/2wvenA)
This feels very inconsistent, as Rust has no problems with extra commas anywhere else. It is also an extremely "natural" mistake to make, so even if it's rightly signaled & easily corrected, it is still quite annoying.