]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0560.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0560.md
1 An unknown field was specified into a structure.
2
3 Erroneous code example:
4
5 ```compile_fail,E0560
6 struct Simba {
7     mother: u32,
8 }
9
10 let s = Simba { mother: 1, father: 0 };
11 // error: structure `Simba` has no field named `father`
12 ```
13
14 Verify you didn't misspell the field's name or that the field exists. Example:
15
16 ```
17 struct Simba {
18     mother: u32,
19     father: u32,
20 }
21
22 let s = Simba { mother: 1, father: 0 }; // ok!
23 ```