diff --git a/macro/src/expand.rs b/macro/src/expand.rs index 8ca2c4af..7e93368b 100644 --- a/macro/src/expand.rs +++ b/macro/src/expand.rs @@ -787,6 +787,7 @@ fn expand_function_pointer_trampoline( prevent_unwind_label, None, Some(&efn.generics), + &efn.attrs, body_span, ); let var = &var.rust; @@ -937,6 +938,7 @@ fn expand_rust_function_shim(efn: &ExternFn, types: &Types) -> TokenStream { prevent_unwind_label, invoke, None, + &efn.attrs, body_span, ) } @@ -949,6 +951,7 @@ fn expand_rust_function_shim_impl( prevent_unwind_label: String, invoke: Option<&Ident>, outer_generics: Option<&Generics>, + attrs: &OtherAttrs, body_span: Span, ) -> TokenStream { let generics = outer_generics.unwrap_or(&sig.generics); @@ -1123,6 +1126,7 @@ fn expand_rust_function_shim_impl( }; quote_spanned! {span=> + #attrs #[doc(hidden)] #[export_name = #link_name] unsafe extern "C" fn #local_name #generics(#(#all_args,)* #outparam #pointer) #ret {