about summary refs log tree commit diff
path: root/tests/ui/attributes/unsafe/double-unsafe-attributes.rs
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-10-02 10:27:49 +0200
committerGitHub <noreply@github.com>2025-10-02 10:27:49 +0200
commitac7beab527861103dd1e1515d534f87956786554 (patch)
tree52d7ecb9c0fd9d077a7a7a897d052734e2629cb7 /tests/ui/attributes/unsafe/double-unsafe-attributes.rs
parent92aac1bdf61642cfc99498ca86e663cf53d2039e (diff)
parent4fc0a0d42a66e9b248fa527f7f063ec7226803dd (diff)
downloadrust-ac7beab527861103dd1e1515d534f87956786554.tar.gz
rust-ac7beab527861103dd1e1515d534f87956786554.zip
Rollup merge of #146535 - joshtriplett:mbe-unsafe-attr, r=petrochenkov
mbe: Implement `unsafe` attribute rules

This implements `unsafe attr` rules for declarative `macro_rules!` attributes, as specified in [RFC 3697](https://github.com/rust-lang/rfcs/pull/3697).

An invocation of an attribute that uses an `unsafe attr` rule requires the `unsafe(attr(...))` syntax.

An invocation of an attribute that uses an ordinary `attr` rule must *not* use the `unsafe(attr(...))` syntax.

`unsafe` is only supported on an `attr` rule, not any other kind of `macro_rules!` rule.

Tracking issue for `macro_rules!` attributes: https://github.com/rust-lang/rust/issues/143547
Diffstat (limited to 'tests/ui/attributes/unsafe/double-unsafe-attributes.rs')
-rw-r--r--tests/ui/attributes/unsafe/double-unsafe-attributes.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/ui/attributes/unsafe/double-unsafe-attributes.rs b/tests/ui/attributes/unsafe/double-unsafe-attributes.rs
index 894d1327da7..c0181d96053 100644
--- a/tests/ui/attributes/unsafe/double-unsafe-attributes.rs
+++ b/tests/ui/attributes/unsafe/double-unsafe-attributes.rs
@@ -1,7 +1,7 @@
 #[unsafe(unsafe(no_mangle))]
 //~^ ERROR expected identifier, found keyword `unsafe`
 //~| ERROR cannot find attribute `r#unsafe` in this scope
-//~| ERROR `r#unsafe` is not an unsafe attribute
+//~| ERROR unnecessary `unsafe`
 fn a() {}
 
 fn main() {}