mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +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()
|
|
};
|
|
}
|