Email me

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.

E0566Attributes, macros and features
Activein rustc 1.99.0
5related errors linked below

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

All 518 Rust error codes · Rust crate data · Glossary

Up next

Often hit nextE0658: is unstableA related error from the same family.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ