]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0071.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0071.md
1 A structure-literal syntax was used to create an item that is not a structure
2 or enum variant.
3
4 Example of erroneous code:
5
6 ```compile_fail,E0071
7 type U32 = u32;
8 let t = U32 { value: 4 }; // error: expected struct, variant or union type,
9                           // found builtin type `u32`
10 ```
11
12 To fix this, ensure that the name was correctly spelled, and that the correct
13 form of initializer was used.
14
15 For example, the code above can be fixed to:
16
17 ```
18 type U32 = u32;
19 let t: U32 = 4;
20 ```
21
22 or:
23
24 ```
25 struct U32 { value: u32 }
26 let t = U32 { value: 4 };
27 ```