rust/tests/ui/attributes/unsafe/unsafe-attributes.rs
carbotaniuman 49db8a5a99 Add toggle for parse_meta_item unsafe parsing
This makes it possible for the `unsafe(...)` syntax to only be
valid at the top level, and the `NestedMetaItem`s will automatically
reject `unsafe(...)`.
2024-07-30 18:28:43 -05:00

14 lines
195 B
Rust

//@ build-pass
#![feature(unsafe_attributes)]
#[unsafe(no_mangle)]
fn a() {}
#[unsafe(export_name = "foo")]
fn b() {}
#[cfg_attr(any(), unsafe(no_mangle))]
static VAR2: u32 = 1;
fn main() {}