diff options
author | 2017-12-09 14:26:38 +0000 | |
---|---|---|
committer | 2017-12-09 14:26:38 +0000 | |
commit | 40ebb93cc6ec8533d4532853c3fd01693af09d8e (patch) | |
tree | 2a452f6e7d7d02bc9d17494554f04afcab8efd63 /macros/src | |
parent | 0a0e0e2b382d826ac7b423c91f39d2abf91a010f (diff) | |
parent | d6c240f9743067c81e68adcf35c60304573db8b9 (diff) | |
download | rtic-40ebb93cc6ec8533d4532853c3fd01693af09d8e.tar.gz rtic-40ebb93cc6ec8533d4532853c3fd01693af09d8e.tar.zst rtic-40ebb93cc6ec8533d4532853c3fd01693af09d8e.zip |
Auto merge of #56 - japaric:not-send, r=japaric
make resource proxies !Send
None
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)* } }) |