rust/src/librustc_error_codes/error_codes/E0634.md
Ayush Mishra 2974685f09
Update src/librustc_error_codes/error_codes/E0634.md
Co-Authored-By: Dylan DPC <dylan.dpc@gmail.com>
2020-03-15 06:49:54 +05:30

425 B

A type has conflicting packed representation hints.

Erroneous code examples:

#[repr(packed, packed(2))] // error!
struct Company(i32);

#[repr(packed(2))] // error!
#[repr(packed)]
struct Company(i32);

You cannot use conflicting packed 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 Company(i32);