summaryrefslogtreecommitdiffstats
path: root/src/test/ui/asm/naked-functions-unused.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/asm/naked-functions-unused.rs
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/asm/naked-functions-unused.rs')
-rw-r--r--src/test/ui/asm/naked-functions-unused.rs87
1 files changed, 0 insertions, 87 deletions
diff --git a/src/test/ui/asm/naked-functions-unused.rs b/src/test/ui/asm/naked-functions-unused.rs
deleted file mode 100644
index 044a0e5b9..000000000
--- a/src/test/ui/asm/naked-functions-unused.rs
+++ /dev/null
@@ -1,87 +0,0 @@
-// revisions: x86_64 aarch64
-// needs-asm-support
-//[x86_64] only-x86_64
-//[aarch64] only-aarch64
-#![deny(unused)]
-#![feature(naked_functions)]
-#![crate_type = "lib"]
-
-pub trait Trait {
- extern "C" fn trait_associated(a: usize, b: usize) -> usize;
- extern "C" fn trait_method(&self, a: usize, b: usize) -> usize;
-}
-
-pub mod normal {
- use std::arch::asm;
-
- pub extern "C" fn function(a: usize, b: usize) -> usize {
- //~^ ERROR unused variable: `a`
- //~| ERROR unused variable: `b`
- unsafe { asm!("", options(noreturn)); }
- }
-
- pub struct Normal;
-
- impl Normal {
- pub extern "C" fn associated(a: usize, b: usize) -> usize {
- //~^ ERROR unused variable: `a`
- //~| ERROR unused variable: `b`
- unsafe { asm!("", options(noreturn)); }
- }
-
- pub extern "C" fn method(&self, a: usize, b: usize) -> usize {
- //~^ ERROR unused variable: `a`
- //~| ERROR unused variable: `b`
- unsafe { asm!("", options(noreturn)); }
- }
- }
-
- impl super::Trait for Normal {
- extern "C" fn trait_associated(a: usize, b: usize) -> usize {
- //~^ ERROR unused variable: `a`
- //~| ERROR unused variable: `b`
- unsafe { asm!("", options(noreturn)); }
- }
-
- extern "C" fn trait_method(&self, a: usize, b: usize) -> usize {
- //~^ ERROR unused variable: `a`
- //~| ERROR unused variable: `b`
- unsafe { asm!("", options(noreturn)); }
- }
- }
-}
-
-pub mod naked {
- use std::arch::asm;
-
- #[naked]
- pub extern "C" fn function(a: usize, b: usize) -> usize {
- unsafe { asm!("", options(noreturn)); }
- }
-
- pub struct Naked;
-
- impl Naked {
- #[naked]
- pub extern "C" fn associated(a: usize, b: usize) -> usize {
- unsafe { asm!("", options(noreturn)); }
- }
-
- #[naked]
- pub extern "C" fn method(&self, a: usize, b: usize) -> usize {
- unsafe { asm!("", options(noreturn)); }
- }
- }
-
- impl super::Trait for Naked {
- #[naked]
- extern "C" fn trait_associated(a: usize, b: usize) -> usize {
- unsafe { asm!("", options(noreturn)); }
- }
-
- #[naked]
- extern "C" fn trait_method(&self, a: usize, b: usize) -> usize {
- unsafe { asm!("", options(noreturn)); }
- }
- }
-}