-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-langRelevant to the language teamRelevant to the language teamregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Milestone
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?
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-langRelevant to the language teamRelevant to the language teamregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.