Debian Codegraph @

gcc/testsuite/rust/compile/missing_constructor_fields.rs

raw
1 // https://doc.rust-lang.org/error_codes/E0063.html
2 struct Foo {
3 x: i32,
4 y: i32,
5 z: i32,
6 }
7
8 fn main() {
9 let z = Foo { x: 0 , y:1 }; // { dg-error "missing field z in initializer of 'Foo'" }
10 let xz = Foo { y:1 }; // { dg-error "missing fields x, z in initializer of 'Foo'" }
11 let xyz = Foo { }; // { dg-error "missing fields x, y, z in initializer of 'Foo'" }
12 }