Skip to content

Commit 1f6f8d0

Browse files
committed
Fix Sync impl of BiLockGuard
1 parent fc1e325 commit 1f6f8d0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

futures-util/src/lock/bilock.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ pub struct BiLockGuard<'a, T> {
224224
bilock: &'a BiLock<T>,
225225
}
226226

227+
// We allow parallel access to T via Deref, so Sync bound is also needed here.
228+
unsafe impl<T: Send + Sync> Sync for BiLockGuard<'_, T> {}
229+
227230
impl<T> Deref for BiLockGuard<'_, T> {
228231
type Target = T;
229232
fn deref(&self) -> &T {

0 commit comments

Comments
 (0)