Skip to content

Commit 879ae3c

Browse files
committed
respect declared unsafety
this is a backport of PR #123
1 parent fb7368e commit 879ae3c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cortex-m-rt/macros/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ pub fn interrupt(args: TokenStream, input: TokenStream) -> TokenStream {
518518
let attrs = f.attrs;
519519
let block = f.block;
520520
let stmts = block.stmts;
521+
let unsafety = f.unsafety;
521522

522523
assert!(
523524
f.constness.is_none()
@@ -564,7 +565,7 @@ pub fn interrupt(args: TokenStream, input: TokenStream) -> TokenStream {
564565
quote!(
565566
#[export_name = #ident_s]
566567
#(#attrs)*
567-
pub extern "C" fn #hash() {
568+
pub #unsafety extern "C" fn #hash() {
568569
interrupt::#ident;
569570

570571
#(#vars)*

0 commit comments

Comments
 (0)