-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
rust-lang/reference
#619Labels
B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-langRelevant to the language teamRelevant to the language team
Description
RFC 1358 introduced #[repr(align(x))]
on structs (and unions). It mentions:
Custom alignment can only be specified on struct declarations for now. Specifying a different alignment on perhaps enum or type definitions should be a backwards-compatible extension.
It would be a nice convenience to allow this for enums, especially when they are part of a public API.
#[repr(align(x))]
enum Foo {
// ...
}
would be equivalent to using AlignX<Foo>
everywhere:
#[repr(align(x))]
struct AlignX<T>(T);
enum Foo {
// ...
}
Metadata
Metadata
Assignees
Labels
B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-langRelevant to the language teamRelevant to the language team