Closed
Description
Code
struct Data {
#[repr(align(8))]
x: [usize; 20]
}
#[repr(align)]
was accepted for arrays in rust v1.50, but is rejected in v1.51.
error[E0517]: attribute should be applied to a struct, enum, or union
--> src/main.rs:3:12
|
3 | #[repr(align(8))]
| ^^^^^^^^
4 | x: [usize; 20]
| -------------- not a struct, enum, or union
I am not entirely sure whether the attribute actually did the alignment in 1.50, or the compiler just ignored it. Regardless, is this expected behavior, and if it is how do I align an array?