Skip to content

Commit 616391e

Browse files
committed
Wrap getting a &mut from a static mut in an unsafe block
Fixes #537
1 parent 57ce011 commit 616391e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream {
8585
{
8686
#(#attrs)*
8787
static mut #ident: #ty = #expr;
88-
&mut #ident
88+
unsafe { &mut #ident }
8989
}
9090
}
9191
})
@@ -486,7 +486,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
486486
{
487487
#(#attrs)*
488488
static mut #ident: #ty = #expr;
489-
&mut #ident
489+
unsafe { &mut #ident }
490490
}
491491
}
492492
})
@@ -596,7 +596,7 @@ pub fn interrupt(args: TokenStream, input: TokenStream) -> TokenStream {
596596
{
597597
#(#attrs)*
598598
static mut #ident: #ty = #expr;
599-
&mut #ident
599+
unsafe { &mut #ident }
600600
}
601601
}
602602
})

0 commit comments

Comments
 (0)