summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0634.md
blob: 0c4ed2596e2aa9562d5eed10f10fd10aa8b1f4a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
A type has conflicting `packed` representation hints.

Erroneous code examples:

```compile_fail,E0634
#[repr(packed, packed(2))] // error!
struct Company(i32);

#[repr(packed(2))] // error!
#[repr(packed)]
struct Company(i32);
```

You cannot use conflicting `packed` hints on a same type. If you want to pack a
type to a given size, you should provide a size to packed:

```
#[repr(packed)] // ok!
struct Company(i32);
```