diff options
Diffstat (limited to 'library/stdarch/crates/assert-instr-macro')
-rw-r--r-- | library/stdarch/crates/assert-instr-macro/Cargo.toml | 2 | ||||
-rw-r--r-- | library/stdarch/crates/assert-instr-macro/src/lib.rs | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/library/stdarch/crates/assert-instr-macro/Cargo.toml b/library/stdarch/crates/assert-instr-macro/Cargo.toml index 4ad654e69..881c8109c 100644 --- a/library/stdarch/crates/assert-instr-macro/Cargo.toml +++ b/library/stdarch/crates/assert-instr-macro/Cargo.toml @@ -11,4 +11,4 @@ test = false [dependencies] proc-macro2 = "1.0" quote = "1.0" -syn = { version = "1.0", features = ["full"] } +syn = { version = "2.0", features = ["full"] } 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 { |