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
  • Loading branch information
jannic committed Sep 17, 2024
1 parent 57ce011 commit 616391e
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 @@ -85,7 +85,7 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream {
{
#(#attrs)*
static mut #ident: #ty = #expr;
&mut #ident
unsafe { &mut #ident }
}
}
})
Expand Down Expand Up @@ -486,7 +486,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
{
#(#attrs)*
static mut #ident: #ty = #expr;
&mut #ident
unsafe { &mut #ident }
}
}
})
Expand Down Expand Up @@ -596,7 +596,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 616391e

Please sign in to comment.