summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0071.md
blob: a6d6d19762b58dde38260fbbfd5842a6a95d012c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
A structure-literal syntax was used to create an item that is not a structure
or enum variant.

Example of erroneous code:

```compile_fail,E0071
type U32 = u32;
let t = U32 { value: 4 }; // error: expected struct, variant or union type,
                          // found builtin type `u32`
```

To fix this, ensure that the name was correctly spelled, and that the correct
form of initializer was used.

For example, the code above can be fixed to:

```
type U32 = u32;
let t: U32 = 4;
```

or:

```
struct U32 { value: u32 }
let t = U32 { value: 4 };
```