about summary refs log tree commit diff
path: root/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-from-pm.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-from-pm.rs')
-rw-r--r--tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-from-pm.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-from-pm.rs b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-from-pm.rs
new file mode 100644
index 00000000000..fbe3ffaf0b8
--- /dev/null
+++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-from-pm.rs
@@ -0,0 +1,18 @@
+// Test for unsafe attributes generated by a proc-macro.
+// See https://github.com/rust-lang/rust/issues/132906
+
+//@ revisions: edition2021 edition2024
+//@[edition2021] check-pass
+//@[edition2021] edition:2021
+//@[edition2024] edition:2024
+//@[edition2024] compile-flags: -Zunstable-options
+//@ aux-crate: unsafe_attributes_pm=unsafe-attributes-pm.rs
+
+unsafe_attributes_pm::missing_unsafe!();
+
+unsafe_attributes_pm::macro_rules_missing_unsafe!();
+//[edition2024]~^ ERROR unsafe attribute used without unsafe
+
+make_fn!();
+
+fn main() {}