Skip to content

Commit

Permalink
Wrap getting a &mut from a static mut in an unsafe block
Browse files Browse the repository at this point in the history
Fixes #537
  • Loading branch information
jannic committed Sep 16, 2024
1 parent 7813e4d commit 601c64b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cortex-m-rt/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream {
{
#(#attrs)*
static mut #ident: #ty = #expr;
&mut #ident
unsafe { &mut #ident }
}
}
})
Expand Down Expand Up @@ -350,7 +350,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
{
#(#attrs)*
static mut #ident: #ty = #expr;
&mut #ident
unsafe { &mut #ident }
}
}
})
Expand Down Expand Up @@ -460,7 +460,7 @@ pub fn interrupt(args: TokenStream, input: TokenStream) -> TokenStream {
{
#(#attrs)*
static mut #ident: #ty = #expr;
&mut #ident
unsafe { &mut #ident }
}
}
})
Expand Down

0 comments on commit 601c64b

Please sign in to comment.