mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
Merge branch 'master' into mox692/add_uring_write
This commit is contained in:
commit
901986c82d
@ -1462,6 +1462,12 @@ impl fmt::Debug for TcpStream {
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRef<Self> for TcpStream {
|
||||
fn as_ref(&self) -> &Self {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
mod sys {
|
||||
use super::TcpStream;
|
||||
|
@ -1076,6 +1076,12 @@ impl fmt::Debug for UnixStream {
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRef<Self> for UnixStream {
|
||||
fn as_ref(&self) -> &Self {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRawFd for UnixStream {
|
||||
fn as_raw_fd(&self) -> RawFd {
|
||||
self.io.as_raw_fd()
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user