rust/tests/ui/structs/struct-field-init-syntax.rs

21 lines
342 B
Rust
Raw Normal View History

// issue #41834
#[derive(Default)]
struct Foo {
one: u8,
}
fn main() {
let foo = Foo {
one: 111,
..Foo::default(),
2017-11-20 12:13:27 +00:00
//~^ ERROR cannot use a comma after the base struct
};
let foo = Foo {
..Foo::default(),
2017-11-20 12:13:27 +00:00
//~^ ERROR cannot use a comma after the base struct
one: 111,
};
}