about summary refs log tree commit diff
path: root/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs')
-rw-r--r--tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs
new file mode 100644
index 00000000000..3a6af9dfb2b
--- /dev/null
+++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs
@@ -0,0 +1,12 @@
+//@ revisions: edition2021 edition2024
+//@[edition2021] edition:2021
+//@[edition2021] check-pass
+//@[edition2024] edition:2024
+//@[edition2024] compile-flags: -Zunstable-options
+
+#![feature(unsafe_attributes)]
+
+#[no_mangle] //[edition2024]~ ERROR: unsafe attribute used without unsafe
+extern "C" fn foo() {}
+
+fn main() {}