Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions tokio/src/sync/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,7 @@ impl<T: ?Sized> Mutex<T> {
/// }
/// ```
pub fn get_mut(&mut self) -> &mut T {
unsafe {
// Safety: This is https://github.com/rust-lang/rust/pull/76936
&mut *self.c.get()
}
self.c.get_mut()
}

/// Attempts to acquire the lock, and returns [`TryLockError`] if the lock
Expand Down
5 changes: 1 addition & 4 deletions tokio/src/sync/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1073,10 +1073,7 @@ impl<T: ?Sized> RwLock<T> {
/// }
/// ```
pub fn get_mut(&mut self) -> &mut T {
unsafe {
// Safety: This is https://github.com/rust-lang/rust/pull/76936
&mut *self.c.get()
}
self.c.get_mut()
}

/// Consumes the lock, returning the underlying data.
Expand Down
Loading