Skip to content

Commit 5a37daf

Browse files
committed
preserve user attributes
1 parent 7c49f48 commit 5a37daf

File tree

1 file changed

+6
-0
lines changed
  • embassy-executor-macros/src/macros

1 file changed

+6
-0
lines changed

embassy-executor-macros/src/macros/main.rs

+6
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ pub fn run(args: TokenStream, item: TokenStream, arch: &Arch) -> TokenStream {
155155
),
156156
};
157157

158+
let mut main_attrs = TokenStream::new();
159+
for attr in f.attrs {
160+
main_attrs.extend(quote!(#attr));
161+
}
162+
158163
if !errors.is_empty() {
159164
main_body = quote! {loop{}};
160165
}
@@ -167,6 +172,7 @@ pub fn run(args: TokenStream, item: TokenStream, arch: &Arch) -> TokenStream {
167172
}
168173

169174
#entry
175+
#main_attrs
170176
fn main() -> #main_ret {
171177
#main_body
172178
}

0 commit comments

Comments
 (0)