mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
23 lines
334 B
Rust
23 lines
334 B
Rust
#[derive(Default)]
|
|
struct Inner {
|
|
a: u8,
|
|
b: u8,
|
|
}
|
|
|
|
#[derive(Default)]
|
|
struct Outer {
|
|
inner: Inner,
|
|
defaulted: u8,
|
|
}
|
|
|
|
fn main(){
|
|
Outer {
|
|
//~^ ERROR missing field `defaulted` in initializer of `Outer`
|
|
inner: Inner {
|
|
a: 1,
|
|
b: 2,
|
|
}
|
|
..Default::default()
|
|
};
|
|
}
|