-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make defmt attributes forward input attributes #293
Conversation
which is sugar for `#[export_name = "$item_name"]
macros/src/lib.rs
Outdated
@@ -95,8 +121,13 @@ pub fn panic_handler(args: TokenStream, input: TokenStream) -> TokenStream { | |||
.into(); | |||
} | |||
|
|||
let attrs = &f.attrs; | |||
if let Err(e) = reject_attributes("panic_handler", attrs, &["export_name", "no_mangle"]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo possible attribute clashes should be documented in https://defmt.ferrous-systems.com/panic.html?highlight=panic_han#defmtpanic_handler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call
macros/src/lib.rs
Outdated
}; | ||
|
||
fn reject_attributes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add a short description of what this function does?
(nit: the function name is a bit misleading, I would've found something like check_attribute_conflict
more helpful but that's really splitting hairs.)
bors r+ |
bors r- |
Canceled. |
bors r=Lotterleben |
Build succeeded: |
work towards fixing #252
#[export_name]
OR#[no_mangle]
)(I was expecting
#[timestamp] #[inline(always)] fn foo() -> u64 { 0 }
to fail at link time but it works ... perhaps export_name undoes inlining?)