about summary refs log tree commit diff
path: root/tests/codegen/cffi
diff options
context:
space:
mode:
authorFolkert de Vries <folkert@folkertdev.nl>2025-04-12 19:58:19 +0200
committerFolkert de Vries <folkert@folkertdev.nl>2025-04-13 01:22:59 +0200
commitf472cc8cd4c57687aac38fe3589818f1cc7956ba (patch)
treee7a243137c6d03c5aa9264c6d3a6cb62ead6679f /tests/codegen/cffi
parent81d8c747fbdb17775dc4e107ad7e430e61a4e751 (diff)
error on unsafe attributes in pre-2024 editions
the `no_mangle`, `link_section` and `export_name` attributes are exceptions, and can still be used without an unsafe in earlier editions
Diffstat (limited to 'tests/codegen/cffi')
-rw-r--r--tests/codegen/cffi/ffi-const.rs2
-rw-r--r--tests/codegen/cffi/ffi-pure.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/codegen/cffi/ffi-const.rs b/tests/codegen/cffi/ffi-const.rs
index 6c90902e89f..3ea9d517ec2 100644
--- a/tests/codegen/cffi/ffi-const.rs
+++ b/tests/codegen/cffi/ffi-const.rs
@@ -10,6 +10,6 @@ extern "C" {
     // CHECK-LABEL: declare{{.*}}void @foo()
     // CHECK-SAME: [[ATTRS:#[0-9]+]]
     // CHECK-DAG: attributes [[ATTRS]] = { {{.*}}memory(none){{.*}} }
-    #[ffi_const]
+    #[unsafe(ffi_const)]
     pub fn foo();
 }
diff --git a/tests/codegen/cffi/ffi-pure.rs b/tests/codegen/cffi/ffi-pure.rs
index 2c5d5f5b4b1..a61e80ecf65 100644
--- a/tests/codegen/cffi/ffi-pure.rs
+++ b/tests/codegen/cffi/ffi-pure.rs
@@ -10,6 +10,6 @@ extern "C" {
     // CHECK-LABEL: declare{{.*}}void @foo()
     // CHECK-SAME: [[ATTRS:#[0-9]+]]
     // CHECK-DAG: attributes [[ATTRS]] = { {{.*}}memory(read){{.*}} }
-    #[ffi_pure]
+    #[unsafe(ffi_pure)]
     pub fn foo();
 }