From f98cf4cefe471fc4ad246172b2a4aeaf91d1496f Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 6 Aug 2026 19:04:54 +0200 Subject: [PATCH 1/2] move naked function ui tests --- .../ffi.rs} | 0 .../ffi.stderr} | 2 +- .../inline.rs} | 0 .../inline.stderr} | 8 +++---- .../instruction-set.rs} | 0 .../invalid-attr.rs} | 0 .../invalid-attr.stderr} | 16 +++++++------- .../invalid-repr-attr.rs} | 0 .../invalid-repr-attr.stderr} | 12 +++++----- .../mono-sym-fn.rs} | 0 .../{ => naked-functions}/naked-functions.rs | 0 .../naked-functions.stderr | 0 .../rustic-abi.rs} | 0 .../shim.rs} | 0 .../target-feature.rs} | 0 .../testattrs.rs} | 0 .../testattrs.stderr} | 8 +++---- .../unused.aarch64.stderr} | 0 .../unused.rs} | 0 .../unused.x86_64.stderr} | 22 +++++++++---------- 20 files changed, 34 insertions(+), 34 deletions(-) rename tests/ui/asm/{naked-functions-ffi.rs => naked-functions/ffi.rs} (100%) rename tests/ui/asm/{naked-functions-ffi.stderr => naked-functions/ffi.stderr} (90%) rename tests/ui/asm/{naked-functions-inline.rs => naked-functions/inline.rs} (100%) rename tests/ui/asm/{naked-functions-inline.stderr => naked-functions/inline.stderr} (87%) rename tests/ui/asm/{naked-functions-instruction-set.rs => naked-functions/instruction-set.rs} (100%) rename tests/ui/asm/{naked-invalid-attr.rs => naked-functions/invalid-attr.rs} (100%) rename tests/ui/asm/{naked-invalid-attr.stderr => naked-functions/invalid-attr.stderr} (84%) rename tests/ui/asm/{naked-with-invalid-repr-attr.rs => naked-functions/invalid-repr-attr.rs} (100%) rename tests/ui/asm/{naked-with-invalid-repr-attr.stderr => naked-functions/invalid-repr-attr.stderr} (79%) rename tests/ui/asm/{naked-asm-mono-sym-fn.rs => naked-functions/mono-sym-fn.rs} (100%) rename tests/ui/asm/{ => naked-functions}/naked-functions.rs (100%) rename tests/ui/asm/{ => naked-functions}/naked-functions.stderr (100%) rename tests/ui/asm/{naked-functions-rustic-abi.rs => naked-functions/rustic-abi.rs} (100%) rename tests/ui/asm/{naked-function-shim.rs => naked-functions/shim.rs} (100%) rename tests/ui/asm/{naked-functions-target-feature.rs => naked-functions/target-feature.rs} (100%) rename tests/ui/asm/{naked-functions-testattrs.rs => naked-functions/testattrs.rs} (100%) rename tests/ui/asm/{naked-functions-testattrs.stderr => naked-functions/testattrs.stderr} (85%) rename tests/ui/asm/{naked-functions-unused.aarch64.stderr => naked-functions/unused.aarch64.stderr} (100%) rename tests/ui/asm/{naked-functions-unused.rs => naked-functions/unused.rs} (100%) rename tests/ui/asm/{naked-functions-unused.x86_64.stderr => naked-functions/unused.x86_64.stderr} (83%) diff --git a/tests/ui/asm/naked-functions-ffi.rs b/tests/ui/asm/naked-functions/ffi.rs similarity index 100% rename from tests/ui/asm/naked-functions-ffi.rs rename to tests/ui/asm/naked-functions/ffi.rs diff --git a/tests/ui/asm/naked-functions-ffi.stderr b/tests/ui/asm/naked-functions/ffi.stderr similarity index 90% rename from tests/ui/asm/naked-functions-ffi.stderr rename to tests/ui/asm/naked-functions/ffi.stderr index f7893a3b8de98..63c0f263e45e0 100644 --- a/tests/ui/asm/naked-functions-ffi.stderr +++ b/tests/ui/asm/naked-functions/ffi.stderr @@ -1,5 +1,5 @@ warning: `extern` fn uses type `char`, which is not FFI-safe - --> $DIR/naked-functions-ffi.rs:8:28 + --> $DIR/ffi.rs:8:28 | LL | pub extern "C" fn naked(p: char) -> u128 { | ^^^^ not FFI-safe diff --git a/tests/ui/asm/naked-functions-inline.rs b/tests/ui/asm/naked-functions/inline.rs similarity index 100% rename from tests/ui/asm/naked-functions-inline.rs rename to tests/ui/asm/naked-functions/inline.rs diff --git a/tests/ui/asm/naked-functions-inline.stderr b/tests/ui/asm/naked-functions/inline.stderr similarity index 87% rename from tests/ui/asm/naked-functions-inline.stderr rename to tests/ui/asm/naked-functions/inline.stderr index 68648be72328e..fa44f92040b4a 100644 --- a/tests/ui/asm/naked-functions-inline.stderr +++ b/tests/ui/asm/naked-functions/inline.stderr @@ -1,5 +1,5 @@ error[E0736]: attribute incompatible with `#[unsafe(naked)]` - --> $DIR/naked-functions-inline.rs:13:3 + --> $DIR/inline.rs:13:3 | LL | #[unsafe(naked)] | ---------------- function marked with `#[unsafe(naked)]` here @@ -7,7 +7,7 @@ LL | #[inline] | ^^^^^^ the `inline` attribute is incompatible with `#[unsafe(naked)]` error[E0736]: attribute incompatible with `#[unsafe(naked)]` - --> $DIR/naked-functions-inline.rs:20:3 + --> $DIR/inline.rs:20:3 | LL | #[unsafe(naked)] | ---------------- function marked with `#[unsafe(naked)]` here @@ -15,7 +15,7 @@ LL | #[inline(always)] | ^^^^^^ the `inline` attribute is incompatible with `#[unsafe(naked)]` error[E0736]: attribute incompatible with `#[unsafe(naked)]` - --> $DIR/naked-functions-inline.rs:27:3 + --> $DIR/inline.rs:27:3 | LL | #[unsafe(naked)] | ---------------- function marked with `#[unsafe(naked)]` here @@ -23,7 +23,7 @@ LL | #[inline(never)] | ^^^^^^ the `inline` attribute is incompatible with `#[unsafe(naked)]` error[E0736]: attribute incompatible with `#[unsafe(naked)]` - --> $DIR/naked-functions-inline.rs:34:18 + --> $DIR/inline.rs:34:18 | LL | #[unsafe(naked)] | ---------------- function marked with `#[unsafe(naked)]` here diff --git a/tests/ui/asm/naked-functions-instruction-set.rs b/tests/ui/asm/naked-functions/instruction-set.rs similarity index 100% rename from tests/ui/asm/naked-functions-instruction-set.rs rename to tests/ui/asm/naked-functions/instruction-set.rs diff --git a/tests/ui/asm/naked-invalid-attr.rs b/tests/ui/asm/naked-functions/invalid-attr.rs similarity index 100% rename from tests/ui/asm/naked-invalid-attr.rs rename to tests/ui/asm/naked-functions/invalid-attr.rs diff --git a/tests/ui/asm/naked-invalid-attr.stderr b/tests/ui/asm/naked-functions/invalid-attr.stderr similarity index 84% rename from tests/ui/asm/naked-invalid-attr.stderr rename to tests/ui/asm/naked-functions/invalid-attr.stderr index 0b55dbe0dbcf0..aa1d2fd07d38f 100644 --- a/tests/ui/asm/naked-invalid-attr.stderr +++ b/tests/ui/asm/naked-functions/invalid-attr.stderr @@ -1,11 +1,11 @@ error[E0433]: cannot find module or crate `a` in the crate root - --> $DIR/naked-invalid-attr.rs:57:5 + --> $DIR/invalid-attr.rs:57:5 | LL | #[::a] | ^ use of unresolved module or unlinked crate `a` error: the `naked` attribute cannot be used on crates - --> $DIR/naked-invalid-attr.rs:5:11 + --> $DIR/invalid-attr.rs:5:11 | LL | #![unsafe(naked)] | ^^^^^ @@ -13,7 +13,7 @@ LL | #![unsafe(naked)] = help: the `naked` attribute can only be applied to functions error: the `naked` attribute cannot be used on foreign functions - --> $DIR/naked-invalid-attr.rs:10:14 + --> $DIR/invalid-attr.rs:10:14 | LL | #[unsafe(naked)] | ^^^^^ @@ -21,7 +21,7 @@ LL | #[unsafe(naked)] = help: the `naked` attribute can only be applied to functions with a body error: the `naked` attribute cannot be used on structs - --> $DIR/naked-invalid-attr.rs:14:10 + --> $DIR/invalid-attr.rs:14:10 | LL | #[unsafe(naked)] | ^^^^^ @@ -29,7 +29,7 @@ LL | #[unsafe(naked)] = help: the `naked` attribute can only be applied to functions error: the `naked` attribute cannot be used on struct fields - --> $DIR/naked-invalid-attr.rs:17:14 + --> $DIR/invalid-attr.rs:17:14 | LL | #[unsafe(naked)] | ^^^^^ @@ -37,7 +37,7 @@ LL | #[unsafe(naked)] = help: the `naked` attribute can only be applied to functions error: the `naked` attribute cannot be used on required trait methods - --> $DIR/naked-invalid-attr.rs:23:14 + --> $DIR/invalid-attr.rs:23:14 | LL | #[unsafe(naked)] | ^^^^^ @@ -45,7 +45,7 @@ LL | #[unsafe(naked)] = help: the `naked` attribute can only be applied to functions with a body error: the `naked` attribute cannot be used on closures - --> $DIR/naked-invalid-attr.rs:52:14 + --> $DIR/invalid-attr.rs:52:14 | LL | #[unsafe(naked)] | ^^^^^ @@ -53,7 +53,7 @@ LL | #[unsafe(naked)] = help: the `naked` attribute can be applied to functions and methods error[E0736]: attribute incompatible with `#[unsafe(naked)]` - --> $DIR/naked-invalid-attr.rs:57:3 + --> $DIR/invalid-attr.rs:57:3 | LL | #[::a] | ^^^ the `::a` attribute is incompatible with `#[unsafe(naked)]` diff --git a/tests/ui/asm/naked-with-invalid-repr-attr.rs b/tests/ui/asm/naked-functions/invalid-repr-attr.rs similarity index 100% rename from tests/ui/asm/naked-with-invalid-repr-attr.rs rename to tests/ui/asm/naked-functions/invalid-repr-attr.rs diff --git a/tests/ui/asm/naked-with-invalid-repr-attr.stderr b/tests/ui/asm/naked-functions/invalid-repr-attr.stderr similarity index 79% rename from tests/ui/asm/naked-with-invalid-repr-attr.stderr rename to tests/ui/asm/naked-functions/invalid-repr-attr.stderr index 7f12510b8aad6..5b9482e3297c5 100644 --- a/tests/ui/asm/naked-with-invalid-repr-attr.stderr +++ b/tests/ui/asm/naked-functions/invalid-repr-attr.stderr @@ -1,5 +1,5 @@ error: the `repr(C)` attribute cannot be used on functions - --> $DIR/naked-with-invalid-repr-attr.rs:10:3 + --> $DIR/invalid-repr-attr.rs:10:3 | LL | #[repr(C)] | ^^^^^^^ @@ -7,7 +7,7 @@ LL | #[repr(C)] = help: the `repr(C)` attribute can only be applied to data types error: the `repr(transparent)` attribute cannot be used on functions - --> $DIR/naked-with-invalid-repr-attr.rs:17:3 + --> $DIR/invalid-repr-attr.rs:17:3 | LL | #[repr(transparent)] | ^^^^^^^^^^^^^^^^^ @@ -15,7 +15,7 @@ LL | #[repr(transparent)] = help: the `repr(transparent)` attribute can only be applied to data types error: the `repr(C)` attribute cannot be used on functions - --> $DIR/naked-with-invalid-repr-attr.rs:24:3 + --> $DIR/invalid-repr-attr.rs:24:3 | LL | #[repr(C)] | ^^^^^^^ @@ -23,7 +23,7 @@ LL | #[repr(C)] = help: the `repr(C)` attribute can only be applied to data types error: the `repr(C)` attribute cannot be used on functions - --> $DIR/naked-with-invalid-repr-attr.rs:33:3 + --> $DIR/invalid-repr-attr.rs:33:3 | LL | #[repr(C, packed)] | ^^^^^^^^^^^^^^^ @@ -31,7 +31,7 @@ LL | #[repr(C, packed)] = help: the `repr(C)` attribute can only be applied to data types error: the `repr(packed)` attribute cannot be used on functions - --> $DIR/naked-with-invalid-repr-attr.rs:33:3 + --> $DIR/invalid-repr-attr.rs:33:3 | LL | #[repr(C, packed)] | ^^^^^^^^^^^^^^^ @@ -39,7 +39,7 @@ LL | #[repr(C, packed)] = help: the `repr(packed)` attribute can only be applied to data types error: the `repr(u8)` attribute cannot be used on functions - --> $DIR/naked-with-invalid-repr-attr.rs:41:3 + --> $DIR/invalid-repr-attr.rs:41:3 | LL | #[repr(u8)] | ^^^^^^^^ diff --git a/tests/ui/asm/naked-asm-mono-sym-fn.rs b/tests/ui/asm/naked-functions/mono-sym-fn.rs similarity index 100% rename from tests/ui/asm/naked-asm-mono-sym-fn.rs rename to tests/ui/asm/naked-functions/mono-sym-fn.rs diff --git a/tests/ui/asm/naked-functions.rs b/tests/ui/asm/naked-functions/naked-functions.rs similarity index 100% rename from tests/ui/asm/naked-functions.rs rename to tests/ui/asm/naked-functions/naked-functions.rs diff --git a/tests/ui/asm/naked-functions.stderr b/tests/ui/asm/naked-functions/naked-functions.stderr similarity index 100% rename from tests/ui/asm/naked-functions.stderr rename to tests/ui/asm/naked-functions/naked-functions.stderr diff --git a/tests/ui/asm/naked-functions-rustic-abi.rs b/tests/ui/asm/naked-functions/rustic-abi.rs similarity index 100% rename from tests/ui/asm/naked-functions-rustic-abi.rs rename to tests/ui/asm/naked-functions/rustic-abi.rs diff --git a/tests/ui/asm/naked-function-shim.rs b/tests/ui/asm/naked-functions/shim.rs similarity index 100% rename from tests/ui/asm/naked-function-shim.rs rename to tests/ui/asm/naked-functions/shim.rs diff --git a/tests/ui/asm/naked-functions-target-feature.rs b/tests/ui/asm/naked-functions/target-feature.rs similarity index 100% rename from tests/ui/asm/naked-functions-target-feature.rs rename to tests/ui/asm/naked-functions/target-feature.rs diff --git a/tests/ui/asm/naked-functions-testattrs.rs b/tests/ui/asm/naked-functions/testattrs.rs similarity index 100% rename from tests/ui/asm/naked-functions-testattrs.rs rename to tests/ui/asm/naked-functions/testattrs.rs diff --git a/tests/ui/asm/naked-functions-testattrs.stderr b/tests/ui/asm/naked-functions/testattrs.stderr similarity index 85% rename from tests/ui/asm/naked-functions-testattrs.stderr rename to tests/ui/asm/naked-functions/testattrs.stderr index ad2041ec118b9..5039a202efb74 100644 --- a/tests/ui/asm/naked-functions-testattrs.stderr +++ b/tests/ui/asm/naked-functions/testattrs.stderr @@ -1,5 +1,5 @@ error[E0736]: cannot use `#[unsafe(naked)]` with testing attributes - --> $DIR/naked-functions-testattrs.rs:11:1 + --> $DIR/testattrs.rs:11:1 | LL | #[test] | ------- function marked with testing attribute here @@ -7,7 +7,7 @@ LL | #[unsafe(naked)] | ^^^^^^^^^^^^^^^^ `#[unsafe(naked)]` is incompatible with testing attributes error[E0736]: cannot use `#[unsafe(naked)]` with testing attributes - --> $DIR/naked-functions-testattrs.rs:19:1 + --> $DIR/testattrs.rs:19:1 | LL | #[test] | ------- function marked with testing attribute here @@ -15,7 +15,7 @@ LL | #[unsafe(naked)] | ^^^^^^^^^^^^^^^^ `#[unsafe(naked)]` is incompatible with testing attributes error[E0736]: cannot use `#[unsafe(naked)]` with testing attributes - --> $DIR/naked-functions-testattrs.rs:27:1 + --> $DIR/testattrs.rs:27:1 | LL | #[test] | ------- function marked with testing attribute here @@ -23,7 +23,7 @@ LL | #[unsafe(naked)] | ^^^^^^^^^^^^^^^^ `#[unsafe(naked)]` is incompatible with testing attributes error[E0736]: cannot use `#[unsafe(naked)]` with testing attributes - --> $DIR/naked-functions-testattrs.rs:34:1 + --> $DIR/testattrs.rs:34:1 | LL | #[bench] | -------- function marked with testing attribute here diff --git a/tests/ui/asm/naked-functions-unused.aarch64.stderr b/tests/ui/asm/naked-functions/unused.aarch64.stderr similarity index 100% rename from tests/ui/asm/naked-functions-unused.aarch64.stderr rename to tests/ui/asm/naked-functions/unused.aarch64.stderr diff --git a/tests/ui/asm/naked-functions-unused.rs b/tests/ui/asm/naked-functions/unused.rs similarity index 100% rename from tests/ui/asm/naked-functions-unused.rs rename to tests/ui/asm/naked-functions/unused.rs diff --git a/tests/ui/asm/naked-functions-unused.x86_64.stderr b/tests/ui/asm/naked-functions/unused.x86_64.stderr similarity index 83% rename from tests/ui/asm/naked-functions-unused.x86_64.stderr rename to tests/ui/asm/naked-functions/unused.x86_64.stderr index bfb2923b0b8d6..a41e80fdc50d6 100644 --- a/tests/ui/asm/naked-functions-unused.x86_64.stderr +++ b/tests/ui/asm/naked-functions/unused.x86_64.stderr @@ -1,66 +1,66 @@ error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:16:32 + --> $DIR/unused.rs:16:32 | LL | pub extern "C" fn function(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` | note: the lint level is defined here - --> $DIR/naked-functions-unused.rs:5:9 + --> $DIR/unused.rs:5:9 | LL | #![deny(unused)] | ^^^^^^ = note: `#[deny(unused_variables)]` implied by `#[deny(unused)]` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:16:42 + --> $DIR/unused.rs:16:42 | LL | pub extern "C" fn function(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:27:38 + --> $DIR/unused.rs:27:38 | LL | pub extern "C" fn associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:27:48 + --> $DIR/unused.rs:27:48 | LL | pub extern "C" fn associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:35:41 + --> $DIR/unused.rs:35:41 | LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:35:51 + --> $DIR/unused.rs:35:51 | LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:45:40 + --> $DIR/unused.rs:45:40 | LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:45:50 + --> $DIR/unused.rs:45:50 | LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:53:43 + --> $DIR/unused.rs:53:43 | LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:53:53 + --> $DIR/unused.rs:53:53 | LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` From 2a773d215e9785c877e81cfbeee581056f1e0f12 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 6 Aug 2026 20:10:35 +0200 Subject: [PATCH 2/2] make test use minicore --- .../asm/naked-functions/unused.aarch64.stderr | 22 +++++++++---------- tests/ui/asm/naked-functions/unused.rs | 19 +++++++++++----- .../asm/naked-functions/unused.x86_64.stderr | 22 +++++++++---------- 3 files changed, 35 insertions(+), 28 deletions(-) diff --git a/tests/ui/asm/naked-functions/unused.aarch64.stderr b/tests/ui/asm/naked-functions/unused.aarch64.stderr index bfb2923b0b8d6..366d338d15b48 100644 --- a/tests/ui/asm/naked-functions/unused.aarch64.stderr +++ b/tests/ui/asm/naked-functions/unused.aarch64.stderr @@ -1,66 +1,66 @@ error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:16:32 + --> $DIR/unused.rs:23:32 | LL | pub extern "C" fn function(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` | note: the lint level is defined here - --> $DIR/naked-functions-unused.rs:5:9 + --> $DIR/unused.rs:11:9 | LL | #![deny(unused)] | ^^^^^^ = note: `#[deny(unused_variables)]` implied by `#[deny(unused)]` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:16:42 + --> $DIR/unused.rs:23:42 | LL | pub extern "C" fn function(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:27:38 + --> $DIR/unused.rs:34:38 | LL | pub extern "C" fn associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:27:48 + --> $DIR/unused.rs:34:48 | LL | pub extern "C" fn associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:35:41 + --> $DIR/unused.rs:42:41 | LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:35:51 + --> $DIR/unused.rs:42:51 | LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:45:40 + --> $DIR/unused.rs:52:40 | LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:45:50 + --> $DIR/unused.rs:52:50 | LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/naked-functions-unused.rs:53:43 + --> $DIR/unused.rs:60:43 | LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/naked-functions-unused.rs:53:53 + --> $DIR/unused.rs:60:53 | LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` diff --git a/tests/ui/asm/naked-functions/unused.rs b/tests/ui/asm/naked-functions/unused.rs index 945ab1a40ad0c..51e3e90c1a72e 100644 --- a/tests/ui/asm/naked-functions/unused.rs +++ b/tests/ui/asm/naked-functions/unused.rs @@ -1,9 +1,16 @@ +//@ add-minicore //@ revisions: x86_64 aarch64 -//@ needs-asm-support -//@[x86_64] only-x86_64 -//@[aarch64] only-aarch64 -#![deny(unused)] +//@[x86_64] compile-flags: --target x86_64-unknown-linux-gnu +//@[x86_64] needs-llvm-components: x86 +//@[aarch64] compile-flags: --target aarch64-unknown-linux-gnu +//@[aarch64] needs-llvm-components: aarch64 +//@ ignore-backends: gcc #![crate_type = "lib"] +#![feature(no_core)] +#![no_core] +#![deny(unused)] + +extern crate minicore; pub trait Trait { extern "C" fn trait_associated(a: usize, b: usize) -> usize; @@ -11,7 +18,7 @@ pub trait Trait { } pub mod normal { - use std::arch::asm; + use minicore::asm; pub extern "C" fn function(a: usize, b: usize) -> usize { //~^ ERROR unused variable: `a` @@ -61,7 +68,7 @@ pub mod normal { } pub mod naked { - use std::arch::naked_asm; + use minicore::naked_asm; #[unsafe(naked)] pub extern "C" fn function(a: usize, b: usize) -> usize { diff --git a/tests/ui/asm/naked-functions/unused.x86_64.stderr b/tests/ui/asm/naked-functions/unused.x86_64.stderr index a41e80fdc50d6..366d338d15b48 100644 --- a/tests/ui/asm/naked-functions/unused.x86_64.stderr +++ b/tests/ui/asm/naked-functions/unused.x86_64.stderr @@ -1,66 +1,66 @@ error: unused variable: `a` - --> $DIR/unused.rs:16:32 + --> $DIR/unused.rs:23:32 | LL | pub extern "C" fn function(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` | note: the lint level is defined here - --> $DIR/unused.rs:5:9 + --> $DIR/unused.rs:11:9 | LL | #![deny(unused)] | ^^^^^^ = note: `#[deny(unused_variables)]` implied by `#[deny(unused)]` error: unused variable: `b` - --> $DIR/unused.rs:16:42 + --> $DIR/unused.rs:23:42 | LL | pub extern "C" fn function(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/unused.rs:27:38 + --> $DIR/unused.rs:34:38 | LL | pub extern "C" fn associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/unused.rs:27:48 + --> $DIR/unused.rs:34:48 | LL | pub extern "C" fn associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/unused.rs:35:41 + --> $DIR/unused.rs:42:41 | LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/unused.rs:35:51 + --> $DIR/unused.rs:42:51 | LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/unused.rs:45:40 + --> $DIR/unused.rs:52:40 | LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/unused.rs:45:50 + --> $DIR/unused.rs:52:50 | LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/unused.rs:53:43 + --> $DIR/unused.rs:60:43 | LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/unused.rs:53:53 + --> $DIR/unused.rs:60:53 | LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize { | ^ help: if this is intentional, prefix it with an underscore: `_b`