Error code E0587

A type has both packed and align representation hints.

Erroneous code example:

#[repr(packed, align(8))] // error!
struct Umbrella(i32);
Run

You cannot use packed and align hints on a same type. If you want to pack a type to a given size, you should provide a size to packed:

#[repr(packed)] // ok!
struct Umbrella(i32);
Run

Back to list of error codes