]> git.proxmox.com Git - rustc.git/blame - src/librustc_error_codes/error_codes/E0071.md
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0071.md
CommitLineData
60c5eb7d
XL
1A structure-literal syntax was used to create an item that is not a structure
2or enum variant.
3
4Example of erroneous code:
5
6```compile_fail,E0071
7type U32 = u32;
8let t = U32 { value: 4 }; // error: expected struct, variant or union type,
9 // found builtin type `u32`
10```
11
12To fix this, ensure that the name was correctly spelled, and that the correct
13form of initializer was used.
14
15For example, the code above can be fixed to:
16
17```
18enum Foo {
19 FirstValue(i32)
20}
21
22fn main() {
23 let u = Foo::FirstValue(0i32);
24
25 let t = 4;
26}
27```