Rust errors / Attributes, macros and features
Rust compiler error · checked with rustc 1.99.0
Rust error E0566: conflicting representation hints
What it meansConflicting representation hints have been used on a same item.
What rustc prints
error[E0566]: conflicting representation hints --> main.rs:1:8 | 1 | #[repr(u32, u64)] | ^^^ ^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #68585 <https://github.com/rust-lang/rust/issues/68585> = note: `#[deny(conflicting_repr_hints)]` (part of `#[deny(future_incompatible)]`) on by default
Real output of rustc 1.99.0 compiling the official example below (2021 edition). Your names and line numbers will differ; the first line is the part to match.
The compiler team's explanation
Conflicting representation hints have been used on a same item.
Erroneous code example:
#[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 }From rustc --explain E0566 (1.99.0), part of the Rust project, MIT or Apache-2.0. Official page.
Related errors
Up next
Often hit nextE0658: is unstableA related error from the same family.Read it next →Did this answer your question?