Skip to content

Commit fb19ebd

Browse files
laizyStjepan Glavina
authored and
Stjepan Glavina
committed
add Sync constraint for RwLock to prevent memory unsafety (#479)
1 parent ab2f64c commit fb19ebd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sync/rwlock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub struct RwLock<T> {
5757
}
5858

5959
unsafe impl<T: Send> Send for RwLock<T> {}
60-
unsafe impl<T: Send> Sync for RwLock<T> {}
60+
unsafe impl<T: Send + Sync> Sync for RwLock<T> {}
6161

6262
impl<T> RwLock<T> {
6363
/// Creates a new reader-writer lock.

0 commit comments

Comments
 (0)