W3cubDocs

/Rust

Error code E0587

A type has both packed and align representation hints.

Erroneous code example:

#![allow(unused)]
fn main() {
#[repr(packed, align(8))] // error!
struct Umbrella(i32);
}

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:

#![allow(unused)]
fn main() {
#[repr(packed(8))] // ok!
struct Umbrella(i32);
}

© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/error_codes/E0587.html