about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-08-08 07:31:12 +0000
committerbors <bors@rust-lang.org>2022-08-08 07:31:12 +0000
commit9b8cfc1eed5eb282c97cee4bbabf9acbdebc5dee (patch)
treeec15a461bcc6f496165b91a64b5dacdd3c486023 /src/test
parent6a11cad7e874a5c3c7fe5cc70d6c96b998437f07 (diff)
parent6eb0c89f6bbe0f81a03b9faa1dca0577a56d8def (diff)
downloadrust-9b8cfc1eed5eb282c97cee4bbabf9acbdebc5dee.tar.gz
rust-9b8cfc1eed5eb282c97cee4bbabf9acbdebc5dee.zip
Auto merge of #98489 - cjgillot:naked-nohir, r=davidtwco,tmiasko
Only fetch HIR for naked functions that have the attribute.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/asm/naked-functions.stderr103
1 files changed, 45 insertions, 58 deletions
diff --git a/src/test/ui/asm/naked-functions.stderr b/src/test/ui/asm/naked-functions.stderr
index 1828066b692..f90967fbe6e 100644
--- a/src/test/ui/asm/naked-functions.stderr
+++ b/src/test/ui/asm/naked-functions.stderr
@@ -57,13 +57,11 @@ LL |     a + 1
 error[E0787]: naked functions must contain a single asm block
   --> $DIR/naked-functions.rs:33:1
    |
-LL | / pub unsafe extern "C" fn inc(a: u32) -> u32 {
-LL | |
-LL | |     a + 1
-   | |     ----- non-asm is unsupported in naked functions
-LL | |
-LL | | }
-   | |_^
+LL | pub unsafe extern "C" fn inc(a: u32) -> u32 {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL |     a + 1
+   |     ----- non-asm is unsupported in naked functions
 
 error: referencing function parameters is not allowed in naked functions
   --> $DIR/naked-functions.rs:42:31
@@ -82,12 +80,11 @@ LL |     asm!("/* {0} */", in(reg) a, options(noreturn));
 error[E0787]: naked functions must contain a single asm block
   --> $DIR/naked-functions.rs:48:1
    |
-LL | / pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
-LL | |
-LL | |     (|| a + 1)()
-   | |     ------------ non-asm is unsupported in naked functions
-LL | | }
-   | |_^
+LL | pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL |     (|| a + 1)()
+   |     ------------ non-asm is unsupported in naked functions
 
 error[E0787]: only `const` and `sym` operands are supported in naked functions
   --> $DIR/naked-functions.rs:65:10
@@ -124,30 +121,25 @@ LL |          sym G, options(noreturn),
 error[E0787]: naked functions must contain a single asm block
   --> $DIR/naked-functions.rs:54:1
    |
-LL | / pub unsafe extern "C" fn unsupported_operands() {
-LL | |
-LL | |     let mut a = 0usize;
-   | |     ------------------- non-asm is unsupported in naked functions
-LL | |     let mut b = 0usize;
-   | |     ------------------- non-asm is unsupported in naked functions
-LL | |     let mut c = 0usize;
-   | |     ------------------- non-asm is unsupported in naked functions
-LL | |     let mut d = 0usize;
-   | |     ------------------- non-asm is unsupported in naked functions
-LL | |     let mut e = 0usize;
-   | |     ------------------- non-asm is unsupported in naked functions
-...  |
-LL | |     );
-LL | | }
-   | |_^
+LL | pub unsafe extern "C" fn unsupported_operands() {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL |     let mut a = 0usize;
+   |     ------------------- non-asm is unsupported in naked functions
+LL |     let mut b = 0usize;
+   |     ------------------- non-asm is unsupported in naked functions
+LL |     let mut c = 0usize;
+   |     ------------------- non-asm is unsupported in naked functions
+LL |     let mut d = 0usize;
+   |     ------------------- non-asm is unsupported in naked functions
+LL |     let mut e = 0usize;
+   |     ------------------- non-asm is unsupported in naked functions
 
 error[E0787]: naked functions must contain a single asm block
   --> $DIR/naked-functions.rs:77:1
    |
-LL | / pub extern "C" fn missing_assembly() {
-LL | |
-LL | | }
-   | |_^
+LL | pub extern "C" fn missing_assembly() {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0787]: asm in naked functions must use `noreturn` option
   --> $DIR/naked-functions.rs:84:5
@@ -185,20 +177,17 @@ LL |     asm!("", options(noreturn));
 error[E0787]: naked functions must contain a single asm block
   --> $DIR/naked-functions.rs:82:1
    |
-LL | / pub extern "C" fn too_many_asm_blocks() {
-LL | |
-LL | |     asm!("");
-LL | |
-LL | |     asm!("");
-   | |     -------- multiple asm blocks are unsupported in naked functions
-LL | |
-LL | |     asm!("");
-   | |     -------- multiple asm blocks are unsupported in naked functions
-LL | |
-LL | |     asm!("", options(noreturn));
-   | |     --------------------------- multiple asm blocks are unsupported in naked functions
-LL | | }
-   | |_^
+LL | pub extern "C" fn too_many_asm_blocks() {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+...
+LL |     asm!("");
+   |     -------- multiple asm blocks are unsupported in naked functions
+LL |
+LL |     asm!("");
+   |     -------- multiple asm blocks are unsupported in naked functions
+LL |
+LL |     asm!("", options(noreturn));
+   |     --------------------------- multiple asm blocks are unsupported in naked functions
 
 error: referencing function parameters is not allowed in naked functions
   --> $DIR/naked-functions.rs:97:11
@@ -211,13 +200,11 @@ LL |         *&y
 error[E0787]: naked functions must contain a single asm block
   --> $DIR/naked-functions.rs:95:5
    |
-LL | /     pub extern "C" fn inner(y: usize) -> usize {
-LL | |
-LL | |         *&y
-   | |         --- non-asm is unsupported in naked functions
-LL | |
-LL | |     }
-   | |_____^
+LL |     pub extern "C" fn inner(y: usize) -> usize {
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL |         *&y
+   |         --- non-asm is unsupported in naked functions
 
 error[E0787]: asm options unsupported in naked functions: `nomem`, `preserves_flags`
   --> $DIR/naked-functions.rs:105:5
@@ -249,18 +236,18 @@ LL |     asm!("", options(noreturn, may_unwind));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: Rust ABI is unsupported in naked functions
-  --> $DIR/naked-functions.rs:124:15
+  --> $DIR/naked-functions.rs:124:1
    |
 LL | pub unsafe fn default_abi() {
-   |               ^^^^^^^^^^^
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(undefined_naked_function_abi)]` on by default
 
 warning: Rust ABI is unsupported in naked functions
-  --> $DIR/naked-functions.rs:130:15
+  --> $DIR/naked-functions.rs:130:1
    |
 LL | pub unsafe fn rust_abi() {
-   |               ^^^^^^^^
+   | ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: naked functions cannot be inlined
   --> $DIR/naked-functions.rs:170:1