aboutsummaryrefslogtreecommitdiff
path: root/macros/src/trans.rs
diff options
context:
space:
mode:
Diffstat (limited to 'macros/src/trans.rs')
-rw-r--r--macros/src/trans.rs8
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)*
}
})