Skip to content

Commit a704c41

Browse files
authored
Merge pull request #3958 from us-irs/preserve-user-attrs-on-main
preserve user attributes on main method
2 parents 7c49f48 + 5a37daf commit a704c41

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

Lines changed: 6 additions & 0 deletions
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)