about summary refs log tree commit diff
path: root/library/stdarch/crates/assert-instr-macro
diff options
context:
space:
mode:
authorEduardo Sánchez Muñoz <eduardosm-dev@e64.io>2023-09-29 18:02:47 +0200
committerAmanieu d'Antras <amanieu@gmail.com>2023-10-01 17:57:00 +0100
commit30a663b4ac5d76d7956e5f91afc19ace224af134 (patch)
tree11b76242a8b5a848ea50dd426de9656236cdb1ab /library/stdarch/crates/assert-instr-macro
parent83668823fda74995d65cb2096f0f14bb733ffd5c (diff)
downloadrust-30a663b4ac5d76d7956e5f91afc19ace224af134.tar.gz
rust-30a663b4ac5d76d7956e5f91afc19ace224af134.zip
Add some `#[allow(deprecated)]`
Diffstat (limited to 'library/stdarch/crates/assert-instr-macro')
-rw-r--r--library/stdarch/crates/assert-instr-macro/src/lib.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/library/stdarch/crates/assert-instr-macro/src/lib.rs b/library/stdarch/crates/assert-instr-macro/src/lib.rs
index 99e37c9105b..dfda3b48bfd 100644
--- a/library/stdarch/crates/assert-instr-macro/src/lib.rs
+++ b/library/stdarch/crates/assert-instr-macro/src/lib.rs
@@ -35,6 +35,15 @@ pub fn assert_instr(
 
     let instr = &invoc.instr;
     let name = &func.sig.ident;
+    let maybe_allow_deprecated = if func
+        .attrs
+        .iter()
+        .any(|attr| attr.path.is_ident("deprecated"))
+    {
+        quote! { #[allow(deprecated)] }
+    } else {
+        quote! {}
+    };
 
     // Disable assert_instr for x86 targets compiled with avx enabled, which
     // causes LLVM to generate different intrinsics that the ones we are
@@ -135,6 +144,7 @@ pub fn assert_instr(
     let to_test = if disable_dedup_guard {
         quote! {
             #attrs
+            #maybe_allow_deprecated
             #[no_mangle]
             #[inline(never)]
             pub unsafe extern #abi fn #shim_name(#(#inputs),*) #ret {
@@ -147,6 +157,7 @@ pub fn assert_instr(
             const #shim_name_ptr : *const u8 = #shim_name_str.as_ptr();
 
             #attrs
+            #maybe_allow_deprecated
             #[no_mangle]
             #[inline(never)]
             pub unsafe extern #abi fn #shim_name(#(#inputs),*) #ret {