From d1412706ecab11ba5ef2a8f20afd039be3d0e9a8 Mon Sep 17 00:00:00 2001 From: Nick Santana Date: Tue, 31 Jan 2023 13:03:23 -0800 Subject: [PATCH] Remove unneeded traits on sys types Previously `Send` and `Sync` were declared on the sys versions of `Mutex`, `RwLock`, and `Condvar`. Per https://doc.rust-lang.org/nomicon/send-and-sync.html these traites are automatically derived when composed entirely of `Send`/`Sync` types. The types from `mc-sgx-tstdc` do derive `Send` and `Sync` so the redeclaring of the traits here is unneeded. --- sync/src/sys/locks/condvar.rs | 3 --- sync/src/sys/locks/mutex.rs | 3 --- sync/src/sys/locks/rwlock.rs | 3 --- 3 files changed, 9 deletions(-) diff --git a/sync/src/sys/locks/condvar.rs b/sync/src/sys/locks/condvar.rs index aed5afc..bd5ca98 100644 --- a/sync/src/sys/locks/condvar.rs +++ b/sync/src/sys/locks/condvar.rs @@ -10,9 +10,6 @@ pub(crate) struct Condvar { inner: SgxCondvar, } -unsafe impl Send for Condvar {} -unsafe impl Sync for Condvar {} - impl Condvar { pub const fn new() -> Self { Self { diff --git a/sync/src/sys/locks/mutex.rs b/sync/src/sys/locks/mutex.rs index 0c53d00..6a89ab7 100644 --- a/sync/src/sys/locks/mutex.rs +++ b/sync/src/sys/locks/mutex.rs @@ -12,9 +12,6 @@ pub(crate) struct Mutex { inner: SgxMutex, } -unsafe impl Send for Mutex {} -unsafe impl Sync for Mutex {} - impl Mutex { /// Create a new Mutex pub(crate) const fn new() -> Mutex { diff --git a/sync/src/sys/locks/rwlock.rs b/sync/src/sys/locks/rwlock.rs index d9b42db..9cb8b9b 100644 --- a/sync/src/sys/locks/rwlock.rs +++ b/sync/src/sys/locks/rwlock.rs @@ -16,9 +16,6 @@ pub(crate) struct RwLock { inner: SgxRwLock, } -unsafe impl Send for RwLock {} -unsafe impl Sync for RwLock {} - impl RwLock { /// Create a new [`RwLock`] pub const fn new() -> RwLock {