mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-01 08:53:29 +00:00

We need a different attribute than `rustc_align` because unstable attributes are tied to their feature (we can't have two unstable features use the same unstable attribute). Otherwise this uses all of the same infrastructure as `#[rustc_align]`.
18 lines
579 B
Rust
18 lines
579 B
Rust
#![feature(static_align)]
|
|
#![crate_type = "lib"]
|
|
|
|
#[rustc_align_static = 16] //~ ERROR malformed `rustc_align_static` attribute input
|
|
static S1: () = ();
|
|
|
|
#[rustc_align_static("hello")] //~ ERROR invalid alignment value: not an unsuffixed integer
|
|
static S2: () = ();
|
|
|
|
#[rustc_align_static(0)] //~ ERROR invalid alignment value: not a power of two
|
|
static S3: () = ();
|
|
|
|
#[repr(align(16))] //~ ERROR `#[repr(align(...))]` is not supported on static
|
|
static S4: () = ();
|
|
|
|
#[rustc_align_static(16)] //~ ERROR `#[rustc_align_static]` attribute cannot be used on structs
|
|
struct Struct1;
|