mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-18 22:05:37 +01:00
parent
eba691a5f2
commit
4f00d8bd78
2 changed files with 25 additions and 1 deletions
|
|
@ -1808,14 +1808,17 @@ fn mk_locals(locals: &HashMap<Ident, Static>, once: bool) -> proc_macro2::TokenS
|
|||
.iter()
|
||||
.map(|(name, static_)| {
|
||||
let attrs = &static_.attrs;
|
||||
let cfgs = &static_.cfgs;
|
||||
let expr = &static_.expr;
|
||||
let ident = name;
|
||||
let ty = &static_.ty;
|
||||
|
||||
quote!(
|
||||
#[allow(non_snake_case)]
|
||||
#(#cfgs)*
|
||||
let #ident: &#lt mut #ty = {
|
||||
#(#attrs)*
|
||||
#(#cfgs)*
|
||||
static mut #ident: #ty = #expr;
|
||||
|
||||
unsafe { &mut #ident }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue