Skip to content
Snippets Groups Projects
Commit 0f5784c2 authored by homunkulus's avatar homunkulus
Browse files

Auto merge of #57 - japaric:not-sync, r=japaric

make resource proxies not Sync

None
parents 40ebb93c 62c5c1ae
No related branches found
No related tags found
No related merge requests found
...@@ -440,8 +440,6 @@ fn resources(app: &App, ownerships: &Ownerships, root: &mut Vec<Tokens>) { ...@@ -440,8 +440,6 @@ fn resources(app: &App, ownerships: &Ownerships, root: &mut Vec<Tokens>) {
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
pub struct #name { _0: PhantomData<*const ()> } pub struct #name { _0: PhantomData<*const ()> }
unsafe impl Sync for #name {}
#[allow(unsafe_code)] #[allow(unsafe_code)]
impl #name { impl #name {
pub unsafe fn new() -> Self { pub unsafe fn new() -> Self {
......
...@@ -41,8 +41,9 @@ fn is_send<T>(_: &T) where T: Send {} ...@@ -41,8 +41,9 @@ fn is_send<T>(_: &T) where T: Send {}
fn is_sync<T>(_: &T) where T: Sync {} fn is_sync<T>(_: &T) where T: Sync {}
fn exti0(_t: &mut Threshold, r: EXTI0::Resources) { fn exti0(_t: &mut Threshold, r: EXTI0::Resources) {
// OK // ERROR resource proxies can't be shared between tasks
is_sync(&r.SHARED); is_sync(&r.SHARED);
//~^ error the trait bound `*const (): core::marker::Sync` is not satisfied
// ERROR resource proxies are not `Send`able across tasks // ERROR resource proxies are not `Send`able across tasks
is_send(&r.SHARED); is_send(&r.SHARED);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment