rust/tests/ui/feature-gates/feature-gate-static_align.rs
Folkert de Vries cbacd00f10
allow #[rustc_align_static(N)] on statics
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]`.
2025-09-09 21:54:54 +02:00

12 lines
320 B
Rust

#![crate_type = "lib"]
#[rustc_align_static(16)]
//~^ ERROR the `#[rustc_align_static]` attribute is an experimental feature
static REQUIRES_ALIGNMENT: u64 = 0;
extern "C" {
#[rustc_align_static(16)]
//~^ ERROR the `#[rustc_align_static]` attribute is an experimental feature
static FOREIGN_STATIC: u32;
}