Skip to content

Commit e41d989

Browse files
authored
Merge pull request #558 from jannic/issue-537
Wrap getting a &mut from a static mut in an unsafe block
2 parents 9aadad7 + 616391e commit e41d989

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
})
@@ -487,7 +487,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
487487
{
488488
#(#attrs)*
489489
static mut #ident: #ty = #expr;
490-
&mut #ident
490+
unsafe { &mut #ident }
491491
}
492492
}
493493
})
@@ -598,7 +598,7 @@ pub fn interrupt(args: TokenStream, input: TokenStream) -> TokenStream {
598598
{
599599
#(#attrs)*
600600
static mut #ident: #ty = #expr;
601-
&mut #ident
601+
unsafe { &mut #ident }
602602
}
603603
}
604604
})

0 commit comments

Comments
 (0)