Don't check default priority (#3693)

This commit is contained in:
Dániel Buga 2025-06-25 16:20:14 +02:00 committed by GitHub
parent 99042a7d60
commit d91806197d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -65,12 +65,17 @@ pub fn handler(args: TokenStream, input: TokenStream) -> TokenStream {
); );
let priority = match priority { let priority = match priority {
Some(priority) => { Some(ref priority) => quote::quote!( {
quote::quote!( #priority ) const {
} core::assert!(
_ => { !matches!(#priority, #root::interrupt::Priority::None),
quote::quote! { #root::interrupt::Priority::min() } "Priority::None is not supported",
} );
};
#priority
} ),
_ => quote::quote! { #root::interrupt::Priority::min() },
}; };
// XXX should we blacklist other attributes? // XXX should we blacklist other attributes?
@ -115,15 +120,6 @@ pub fn handler(args: TokenStream, input: TokenStream) -> TokenStream {
quote::quote_spanned!(original_span => quote::quote_spanned!(original_span =>
#f #f
const _: () = {
core::assert!(
match #priority {
#root::interrupt::Priority::None => false,
_ => true,
},
"Priority::None is not supported");
};
#[allow(non_upper_case_globals)] #[allow(non_upper_case_globals)]
#vis const #orig: #root::interrupt::InterruptHandler = #root::interrupt::InterruptHandler::new(#new, #priority); #vis const #orig: #root::interrupt::InterruptHandler = #root::interrupt::InterruptHandler::new(#new, #priority);
) )