diff options
Diffstat (limited to 'compiler/rustc_error_codes/src/error_codes/E0566.md')
-rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0566.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0566.md b/compiler/rustc_error_codes/src/error_codes/E0566.md new file mode 100644 index 000000000..3dcd801a2 --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0566.md @@ -0,0 +1,18 @@ +Conflicting representation hints have been used on a same item. + +Erroneous code example: + +```compile_fail,E0566 +#[repr(u32, u64)] +enum Repr { A } +``` + +In most cases (if not all), using just one representation hint is more than +enough. If you want to have a representation hint depending on the current +architecture, use `cfg_attr`. Example: + +``` +#[cfg_attr(linux, repr(u32))] +#[cfg_attr(not(linux), repr(u64))] +enum Repr { A } +``` |