From 161926c3a4b94285b5a5e6a74fe6b093d35a8e93 Mon Sep 17 00:00:00 2001 From: Sunjay Varma Date: Wed, 21 Apr 2021 16:51:36 -0700 Subject: [PATCH] Updating Send and Sync impls on MappedMutexGuard to match parking_lot --- tokio/src/sync/mutex.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tokio/src/sync/mutex.rs b/tokio/src/sync/mutex.rs index 2e8dfd6f473..9fd7c912b6d 100644 --- a/tokio/src/sync/mutex.rs +++ b/tokio/src/sync/mutex.rs @@ -180,7 +180,8 @@ unsafe impl Send for Mutex where T: ?Sized + Send {} unsafe impl Sync for Mutex where T: ?Sized + Send {} unsafe impl Sync for MutexGuard<'_, T> where T: ?Sized + Send + Sync {} unsafe impl Sync for OwnedMutexGuard where T: ?Sized + Send + Sync {} -unsafe impl Sync for MappedMutexGuard<'_, T> where T: ?Sized + Send + Sync {} +unsafe impl<'a, T> Sync for MappedMutexGuard<'a, T> where T: ?Sized + Sync + 'a {} +unsafe impl<'a, T> Send for MappedMutexGuard<'a, T> where T: ?Sized + Send + 'a {} /// Error returned from the [`Mutex::try_lock`], [`RwLock::try_read`] and /// [`RwLock::try_write`] functions.