]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0634.md
5057aa6094e1b0ec1766bdaaafabd0e209edda4f
[rust.git] / src / librustc_error_codes / error_codes / E0634.md
1 A type has conflicting `packed` representation hint.
2
3 Erroneous code examples:
4
5 ```compile_fail,E0634
6 #[repr(packed, packed(2))] // error!
7 struct Company(i32);
8
9 #[repr(packed(2))] // error!
10 #[repr(packed)]
11 struct Company(i32);
12 ```
13
14 You cannot use conflicting `packed` hint on a same type. If you want to pack a
15 type to a given size, you should provide a size to packed:
16
17 ```
18 #[repr(packed)] // ok!
19 struct Company(i32);
20 ```