]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0566.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0566.md
1 Conflicting representation hints have been used on a same item.
2
3 Erroneous code example:
4
5 ```compile_fail,E0566
6 #[repr(u32, u64)]
7 enum Repr { A }
8 ```
9
10 In most cases (if not all), using just one representation hint is more than
11 enough. If you want to have a representation hint depending on the current
12 architecture, use `cfg_attr`. Example:
13
14 ```
15 #[cfg_attr(linux, repr(u32))]
16 #[cfg_attr(not(linux), repr(u64))]
17 enum Repr { A }
18 ```