summaryrefslogtreecommitdiffstats
path: root/library/stdarch/crates/assert-instr-macro/src
diff options
context:
space:
mode:
Diffstat (limited to 'library/stdarch/crates/assert-instr-macro/src')
-rw-r--r--library/stdarch/crates/assert-instr-macro/src/lib.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/library/stdarch/crates/assert-instr-macro/src/lib.rs b/library/stdarch/crates/assert-instr-macro/src/lib.rs
index 99e37c910..c9de43943 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
@@ -108,7 +117,7 @@ pub fn assert_instr(
.attrs
.iter()
.filter(|attr| {
- attr.path
+ attr.path()
.segments
.first()
.expect("attr.path.segments.first() failed")
@@ -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 {