]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0063.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0063.md
1 A struct's or struct-like enum variant's field was not provided.
2
3 Erroneous code example:
4
5 ```compile_fail,E0063
6 struct Foo {
7     x: i32,
8     y: i32,
9 }
10
11 fn main() {
12     let x = Foo { x: 0 }; // error: missing field: `y`
13 }
14 ```
15
16 Each field should be specified exactly once. Example:
17
18 ```
19 struct Foo {
20     x: i32,
21     y: i32,
22 }
23
24 fn main() {
25     let x = Foo { x: 0, y: 0 }; // ok!
26 }
27 ```