]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0587.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0587.md
1 A type has both `packed` and `align` representation hints.
2
3 Erroneous code example:
4
5 ```compile_fail,E0587
6 #[repr(packed, align(8))] // error!
7 struct Umbrella(i32);
8 ```
9
10 You cannot use `packed` and `align` hints on a same type. If you want to pack a
11 type to a given size, you should provide a size to packed:
12
13 ```
14 #[repr(packed)] // ok!
15 struct Umbrella(i32);
16 ```