]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0063.md
Auto merge of #66396 - smmalis37:pythontest, r=alexcrichton
[rust.git] / src / librustc_error_codes / error_codes / E0063.md
1 This error indicates that during an attempt to build a struct or struct-like
2 enum variant, one of the fields was not provided. Erroneous code example:
3
4 ```compile_fail,E0063
5 struct Foo {
6     x: i32,
7     y: i32,
8 }
9
10 fn main() {
11     let x = Foo { x: 0 }; // error: missing field: `y`
12 }
13 ```
14
15 Each field should be specified exactly once. Example:
16
17 ```
18 struct Foo {
19     x: i32,
20     y: i32,
21 }
22
23 fn main() {
24     let x = Foo { x: 0, y: 0 }; // ok!
25 }
26 ```