diff options
author | 2017-12-09 15:10:29 +0100 | |
---|---|---|
committer | 2017-12-09 15:10:29 +0100 | |
commit | 9865a7246df289bfa5f65ba47c883c4ce3e108a9 (patch) | |
tree | f4558bdee906ff386605586cabb988b5793265dc /macros/src | |
parent | 0a0e0e2b382d826ac7b423c91f39d2abf91a010f (diff) | |
download | rtic-9865a7246df289bfa5f65ba47c883c4ce3e108a9.tar.gz rtic-9865a7246df289bfa5f65ba47c883c4ce3e108a9.tar.zst rtic-9865a7246df289bfa5f65ba47c883c4ce3e108a9.zip |
make resource proxies !Send
Diffstat (limited to 'macros/src')
-rw-r--r-- | macros/src/trans.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/macros/src/trans.rs b/macros/src/trans.rs index 96631d5d..77eada41 100644 --- a/macros/src/trans.rs +++ b/macros/src/trans.rs @@ -438,12 +438,14 @@ fn resources(app: &App, ownerships: &Ownerships, root: &mut Vec<Tokens>) { items.push(quote! { #[allow(non_camel_case_types)] - pub struct #name { _0: () } + pub struct #name { _0: PhantomData<*const ()> } + + unsafe impl Sync for #name {} #[allow(unsafe_code)] impl #name { pub unsafe fn new() -> Self { - #name { _0: () } + #name { _0: PhantomData } } } }); @@ -455,6 +457,8 @@ fn resources(app: &App, ownerships: &Ownerships, root: &mut Vec<Tokens>) { root.push(quote! { #[allow(unsafe_code)] mod _resource { + use core::marker::PhantomData; + #(#items)* } }) |