1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#[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() }; }