about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFolkert <folkert@folkertdev.nl>2024-08-04 17:19:08 +0200
committerFolkert de Vries <folkert@folkertdev.nl>2024-10-06 18:12:25 +0200
commit1a9c1cbf367fb2b6f04a0a81d7fae56485e29e7f (patch)
treebeee9a143be88502ea9db5f8e8cc8047c9fd8e76
parent47b42bef3226bb71506988572c73ec1b6f99a730 (diff)
downloadrust-1a9c1cbf367fb2b6f04a0a81d7fae56485e29e7f.tar.gz
rust-1a9c1cbf367fb2b6f04a0a81d7fae56485e29e7f.zip
use `naked_asm!` in feature-gate-naked_functions test
-rw-r--r--tests/ui/feature-gates/feature-gate-naked_functions.rs9
-rw-r--r--tests/ui/feature-gates/feature-gate-naked_functions.stderr48
2 files changed, 45 insertions, 12 deletions
diff --git a/tests/ui/feature-gates/feature-gate-naked_functions.rs b/tests/ui/feature-gates/feature-gate-naked_functions.rs
index 298b687e4f2..c8802ea4c31 100644
--- a/tests/ui/feature-gates/feature-gate-naked_functions.rs
+++ b/tests/ui/feature-gates/feature-gate-naked_functions.rs
@@ -1,19 +1,22 @@
 //@ needs-asm-support
 
-use std::arch::asm;
+use std::arch::naked_asm;
+//~^ ERROR use of unstable library feature 'naked_functions'
 
 #[naked]
 //~^ the `#[naked]` attribute is an experimental feature
 extern "C" fn naked() {
     naked_asm!("", options(noreturn))
-    //~^ ERROR: requires unsafe
+    //~^ ERROR use of unstable library feature 'naked_functions'
+    //~| ERROR: requires unsafe
 }
 
 #[naked]
 //~^ the `#[naked]` attribute is an experimental feature
 extern "C" fn naked_2() -> isize {
     naked_asm!("", options(noreturn))
-    //~^ ERROR: requires unsafe
+    //~^ ERROR use of unstable library feature 'naked_functions'
+    //~| ERROR: requires unsafe
 }
 
 fn main() {}
diff --git a/tests/ui/feature-gates/feature-gate-naked_functions.stderr b/tests/ui/feature-gates/feature-gate-naked_functions.stderr
index ffdf31e147a..5fecc218a16 100644
--- a/tests/ui/feature-gates/feature-gate-naked_functions.stderr
+++ b/tests/ui/feature-gates/feature-gate-naked_functions.stderr
@@ -1,5 +1,25 @@
+error[E0658]: use of unstable library feature 'naked_functions'
+  --> $DIR/feature-gate-naked_functions.rs:9:5
+   |
+LL |     naked_asm!("", options(noreturn))
+   |     ^^^^^^^^^
+   |
+   = note: see issue #90957 <https://github.com/rust-lang/rust/issues/90957> for more information
+   = help: add `#![feature(naked_functions)]` to the crate attributes to enable
+   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+
+error[E0658]: use of unstable library feature 'naked_functions'
+  --> $DIR/feature-gate-naked_functions.rs:17:5
+   |
+LL |     naked_asm!("", options(noreturn))
+   |     ^^^^^^^^^
+   |
+   = note: see issue #90957 <https://github.com/rust-lang/rust/issues/90957> for more information
+   = help: add `#![feature(naked_functions)]` to the crate attributes to enable
+   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+
 error[E0658]: the `#[naked]` attribute is an experimental feature
-  --> $DIR/feature-gate-naked_functions.rs:5:1
+  --> $DIR/feature-gate-naked_functions.rs:6:1
    |
 LL | #[naked]
    | ^^^^^^^^
@@ -9,7 +29,7 @@ LL | #[naked]
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: the `#[naked]` attribute is an experimental feature
-  --> $DIR/feature-gate-naked_functions.rs:12:1
+  --> $DIR/feature-gate-naked_functions.rs:14:1
    |
 LL | #[naked]
    | ^^^^^^^^
@@ -18,23 +38,33 @@ LL | #[naked]
    = help: add `#![feature(naked_functions)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
+error[E0658]: use of unstable library feature 'naked_functions'
+  --> $DIR/feature-gate-naked_functions.rs:3:5
+   |
+LL | use std::arch::naked_asm;
+   |     ^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #90957 <https://github.com/rust-lang/rust/issues/90957> for more information
+   = help: add `#![feature(naked_functions)]` to the crate attributes to enable
+   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+
 error[E0133]: use of inline assembly is unsafe and requires unsafe function or block
-  --> $DIR/feature-gate-naked_functions.rs:8:5
+  --> $DIR/feature-gate-naked_functions.rs:9:5
    |
-LL |     asm!("", options(noreturn))
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of inline assembly
+LL |     naked_asm!("", options(noreturn))
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of inline assembly
    |
    = note: inline assembly is entirely unchecked and can cause undefined behavior
 
 error[E0133]: use of inline assembly is unsafe and requires unsafe function or block
-  --> $DIR/feature-gate-naked_functions.rs:15:5
+  --> $DIR/feature-gate-naked_functions.rs:17:5
    |
-LL |     asm!("", options(noreturn))
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of inline assembly
+LL |     naked_asm!("", options(noreturn))
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of inline assembly
    |
    = note: inline assembly is entirely unchecked and can cause undefined behavior
 
-error: aborting due to 4 previous errors
+error: aborting due to 7 previous errors
 
 Some errors have detailed explanations: E0133, E0658.
 For more information about an error, try `rustc --explain E0133`.