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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

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 06:13:27 -06:00
//~^ ERROR cannot use a comma after the base struct
};
let foo = Foo {
..Foo::default(),
2017-11-20 06:13:27 -06:00
//~^ ERROR cannot use a comma after the base struct
one: 111,
};
}