diff options
| author | carbotaniuman <41451839+carbotaniuman@users.noreply.github.com> | 2024-07-09 19:06:49 -0500 |
|---|---|---|
| committer | carbotaniuman <41451839+carbotaniuman@users.noreply.github.com> | 2024-07-30 18:28:43 -0500 |
| commit | 49db8a5a999f0908b5bf74b88a2d72a4f4dddf48 (patch) | |
| tree | a080b5f39b3e923e2a2057102cf88362757f316c /tests/ui/attributes/unsafe/unsafe-attributes.rs | |
| parent | d8bc8761a5bb8456c0b7940434b3b3b4f0ed035c (diff) | |
| download | rust-49db8a5a999f0908b5bf74b88a2d72a4f4dddf48.tar.gz rust-49db8a5a999f0908b5bf74b88a2d72a4f4dddf48.zip | |
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(...)`.
Diffstat (limited to 'tests/ui/attributes/unsafe/unsafe-attributes.rs')
| -rw-r--r-- | tests/ui/attributes/unsafe/unsafe-attributes.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/ui/attributes/unsafe/unsafe-attributes.rs b/tests/ui/attributes/unsafe/unsafe-attributes.rs index e7620a18048..33a412add50 100644 --- a/tests/ui/attributes/unsafe/unsafe-attributes.rs +++ b/tests/ui/attributes/unsafe/unsafe-attributes.rs @@ -4,4 +4,10 @@ #[unsafe(no_mangle)] fn a() {} +#[unsafe(export_name = "foo")] +fn b() {} + +#[cfg_attr(any(), unsafe(no_mangle))] +static VAR2: u32 = 1; + fn main() {} |
