diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index 30e553f285b..6640c7fb162 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -709,6 +709,7 @@ pub fn set_modified(&self, time: SystemTime) -> io::Result<()> { // `AsRawHandle`/`IntoRawHandle`/`FromRawHandle` on Windows. impl AsInner for File { + #[inline] fn as_inner(&self) -> &fs_imp::File { &self.inner } @@ -1087,12 +1088,14 @@ fn _open(&self, path: &Path) -> io::Result { } impl AsInner for OpenOptions { + #[inline] fn as_inner(&self) -> &fs_imp::OpenOptions { &self.0 } } impl AsInnerMut for OpenOptions { + #[inline] fn as_inner_mut(&mut self) -> &mut fs_imp::OpenOptions { &mut self.0 } @@ -1352,6 +1355,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { } impl AsInner for Metadata { + #[inline] fn as_inner(&self) -> &fs_imp::FileAttr { &self.0 } @@ -1604,6 +1608,7 @@ pub fn is_symlink(&self) -> bool { } impl AsInner for FileType { + #[inline] fn as_inner(&self) -> &fs_imp::FileType { &self.0 } @@ -1616,6 +1621,7 @@ fn from_inner(f: fs_imp::FilePermissions) -> Permissions { } impl AsInner for Permissions { + #[inline] fn as_inner(&self) -> &fs_imp::FilePermissions { &self.0 } @@ -1770,6 +1776,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { } impl AsInner for DirEntry { + #[inline] fn as_inner(&self) -> &fs_imp::DirEntry { &self.0 } @@ -2510,6 +2517,7 @@ fn create_dir_all(&self, path: &Path) -> io::Result<()> { } impl AsInnerMut for DirBuilder { + #[inline] fn as_inner_mut(&mut self) -> &mut fs_imp::DirBuilder { &mut self.inner } diff --git a/library/std/src/net/tcp.rs b/library/std/src/net/tcp.rs index 4b42ad65ee6..541e95d229b 100644 --- a/library/std/src/net/tcp.rs +++ b/library/std/src/net/tcp.rs @@ -691,6 +691,7 @@ fn flush(&mut self) -> io::Result<()> { } impl AsInner for TcpStream { + #[inline] fn as_inner(&self) -> &net_imp::TcpStream { &self.0 } @@ -1033,6 +1034,7 @@ fn next(&mut self) -> Option> { impl FusedIterator for IntoIncoming {} impl AsInner for TcpListener { + #[inline] fn as_inner(&self) -> &net_imp::TcpListener { &self.0 } diff --git a/library/std/src/net/udp.rs b/library/std/src/net/udp.rs index 864e1b0f345..9628bcc5108 100644 --- a/library/std/src/net/udp.rs +++ b/library/std/src/net/udp.rs @@ -788,6 +788,7 @@ pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { // `AsRawSocket`/`IntoRawSocket`/`FromRawSocket` on Windows. impl AsInner for UdpSocket { + #[inline] fn as_inner(&self) -> &net_imp::UdpSocket { &self.0 } diff --git a/library/std/src/os/linux/process.rs b/library/std/src/os/linux/process.rs index 540363c0349..2b3ff76d7a4 100644 --- a/library/std/src/os/linux/process.rs +++ b/library/std/src/os/linux/process.rs @@ -52,6 +52,7 @@ pub struct PidFd { } impl AsInner for PidFd { + #[inline] fn as_inner(&self) -> &FileDesc { &self.inner } @@ -70,6 +71,7 @@ fn into_inner(self) -> FileDesc { } impl AsRawFd for PidFd { + #[inline] fn as_raw_fd(&self) -> RawFd { self.as_inner().as_raw_fd() } diff --git a/library/std/src/process.rs b/library/std/src/process.rs index 0ab72f7ea7a..bf22c2d46c9 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -211,6 +211,7 @@ pub struct Child { impl crate::sealed::Sealed for Child {} impl AsInner for Child { + #[inline] fn as_inner(&self) -> &imp::Process { &self.handle } @@ -304,6 +305,7 @@ fn flush(&mut self) -> io::Result<()> { } impl AsInner for ChildStdin { + #[inline] fn as_inner(&self) -> &AnonPipe { &self.inner } @@ -373,6 +375,7 @@ fn read_to_end(&mut self, buf: &mut Vec) -> io::Result { } impl AsInner for ChildStdout { + #[inline] fn as_inner(&self) -> &AnonPipe { &self.inner } @@ -438,6 +441,7 @@ fn is_read_vectored(&self) -> bool { } impl AsInner for ChildStderr { + #[inline] fn as_inner(&self) -> &AnonPipe { &self.inner } @@ -1107,12 +1111,14 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { } impl AsInner for Command { + #[inline] fn as_inner(&self) -> &imp::Command { &self.inner } } impl AsInnerMut for Command { + #[inline] fn as_inner_mut(&mut self) -> &mut imp::Command { &mut self.inner } @@ -1605,6 +1611,7 @@ pub fn code(&self) -> Option { } impl AsInner for ExitStatus { + #[inline] fn as_inner(&self) -> &imp::ExitStatus { &self.0 } @@ -1884,6 +1891,7 @@ fn from(code: u8) -> Self { } impl AsInner for ExitCode { + #[inline] fn as_inner(&self) -> &imp::ExitCode { &self.0 } diff --git a/library/std/src/sys/hermit/fd.rs b/library/std/src/sys/hermit/fd.rs index 3a2cdd301ea..ccde05aa1d7 100644 --- a/library/std/src/sys/hermit/fd.rs +++ b/library/std/src/sys/hermit/fd.rs @@ -75,6 +75,7 @@ unsafe fn from_raw_fd(raw_fd: RawFd) -> Self { } impl AsInner for FileDesc { + #[inline] fn as_inner(&self) -> &OwnedFd { &self.fd } diff --git a/library/std/src/sys/hermit/fs.rs b/library/std/src/sys/hermit/fs.rs index cf0b271761f..4bb735668d2 100644 --- a/library/std/src/sys/hermit/fs.rs +++ b/library/std/src/sys/hermit/fs.rs @@ -367,12 +367,14 @@ pub fn mkdir(&self, _p: &Path) -> io::Result<()> { } impl AsInner for File { + #[inline] fn as_inner(&self) -> &FileDesc { &self.0 } } impl AsInnerMut for File { + #[inline] fn as_inner_mut(&mut self) -> &mut FileDesc { &mut self.0 } @@ -397,6 +399,7 @@ fn as_fd(&self) -> BorrowedFd<'_> { } impl AsRawFd for File { + #[inline] fn as_raw_fd(&self) -> RawFd { self.0.as_raw_fd() } diff --git a/library/std/src/sys/hermit/net.rs b/library/std/src/sys/hermit/net.rs index d6f64a29719..8c2d489d6a3 100644 --- a/library/std/src/sys/hermit/net.rs +++ b/library/std/src/sys/hermit/net.rs @@ -340,6 +340,7 @@ pub fn as_raw(&self) -> RawFd { } impl AsInner for Socket { + #[inline] fn as_inner(&self) -> &FileDesc { &self.0 } @@ -364,6 +365,7 @@ fn as_fd(&self) -> BorrowedFd<'_> { } impl AsRawFd for Socket { + #[inline] fn as_raw_fd(&self) -> RawFd { self.0.as_raw_fd() } diff --git a/library/std/src/sys/sgx/fd.rs b/library/std/src/sys/sgx/fd.rs index 0c02a107691..b3686d0e283 100644 --- a/library/std/src/sys/sgx/fd.rs +++ b/library/std/src/sys/sgx/fd.rs @@ -62,6 +62,7 @@ pub fn flush(&self) -> io::Result<()> { } impl AsInner for FileDesc { + #[inline] fn as_inner(&self) -> &Fd { &self.fd } diff --git a/library/std/src/sys/sgx/net.rs b/library/std/src/sys/sgx/net.rs index 923be5eb944..03620a08f2c 100644 --- a/library/std/src/sys/sgx/net.rs +++ b/library/std/src/sys/sgx/net.rs @@ -24,6 +24,7 @@ fn new(fd: usercalls::raw::Fd, local_addr: String) -> Socket { } impl AsInner for Socket { + #[inline] fn as_inner(&self) -> &FileDesc { &self.inner } @@ -220,6 +221,7 @@ pub fn set_nonblocking(&self, _: bool) -> io::Result<()> { } impl AsInner for TcpStream { + #[inline] fn as_inner(&self) -> &Socket { &self.inner } @@ -304,6 +306,7 @@ pub fn set_nonblocking(&self, _: bool) -> io::Result<()> { } impl AsInner for TcpListener { + #[inline] fn as_inner(&self) -> &Socket { &self.inner } diff --git a/library/std/src/sys/solid/net.rs b/library/std/src/sys/solid/net.rs index 7d7bfae1432..0bd2bc3b961 100644 --- a/library/std/src/sys/solid/net.rs +++ b/library/std/src/sys/solid/net.rs @@ -112,6 +112,7 @@ fn duplicate(&self) -> io::Result { } impl AsInner for FileDesc { + #[inline] fn as_inner(&self) -> &c_int { &self.fd } @@ -462,6 +463,7 @@ pub fn as_raw(&self) -> c_int { } impl AsInner for Socket { + #[inline] fn as_inner(&self) -> &c_int { self.0.as_inner() } diff --git a/library/std/src/sys/unix/fd.rs b/library/std/src/sys/unix/fd.rs index ce5c048f252..45f96478fc3 100644 --- a/library/std/src/sys/unix/fd.rs +++ b/library/std/src/sys/unix/fd.rs @@ -481,6 +481,7 @@ fn is_read_vectored(&self) -> bool { } impl AsInner for FileDesc { + #[inline] fn as_inner(&self) -> &OwnedFd { &self.0 } @@ -505,6 +506,7 @@ fn as_fd(&self) -> BorrowedFd<'_> { } impl AsRawFd for FileDesc { + #[inline] fn as_raw_fd(&self) -> RawFd { self.0.as_raw_fd() } diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs index 2a5a14209a1..b398fd5eb24 100644 --- a/library/std/src/sys/unix/fs.rs +++ b/library/std/src/sys/unix/fs.rs @@ -547,6 +547,7 @@ pub fn created(&self) -> io::Result { } impl AsInner for FileAttr { + #[inline] fn as_inner(&self) -> &stat64 { &self.stat } @@ -1269,12 +1270,14 @@ pub fn set_mode(&mut self, mode: u32) { } impl AsInner for File { + #[inline] fn as_inner(&self) -> &FileDesc { &self.0 } } impl AsInnerMut for File { + #[inline] fn as_inner_mut(&mut self) -> &mut FileDesc { &mut self.0 } @@ -1299,6 +1302,7 @@ fn as_fd(&self) -> BorrowedFd<'_> { } impl AsRawFd for File { + #[inline] fn as_raw_fd(&self) -> RawFd { self.0.as_raw_fd() } diff --git a/library/std/src/sys/unix/l4re.rs b/library/std/src/sys/unix/l4re.rs index 9967588939a..ee016887e70 100644 --- a/library/std/src/sys/unix/l4re.rs +++ b/library/std/src/sys/unix/l4re.rs @@ -129,6 +129,7 @@ pub fn as_raw(&self) -> RawFd { } impl AsInner for Socket { + #[inline] fn as_inner(&self) -> &FileDesc { &self.0 } @@ -153,6 +154,7 @@ fn as_fd(&self) -> BorrowedFd<'_> { } impl AsRawFd for Socket { + #[inline] fn as_raw_fd(&self) -> RawFd { self.0.as_raw_fd() } @@ -183,6 +185,7 @@ pub fn connect_timeout(_: &SocketAddr, _: Duration) -> io::Result { unimpl!(); } + #[inline] pub fn socket(&self) -> &Socket { &self.inner } @@ -305,6 +308,7 @@ pub fn bind(_: io::Result<&SocketAddr>) -> io::Result { unimpl!(); } + #[inline] pub fn socket(&self) -> &Socket { &self.inner } @@ -371,6 +375,7 @@ pub fn bind(_: io::Result<&SocketAddr>) -> io::Result { unimpl!(); } + #[inline] pub fn socket(&self) -> &Socket { &self.inner } diff --git a/library/std/src/sys/unix/net.rs b/library/std/src/sys/unix/net.rs index 573bfa6587e..39edb136c24 100644 --- a/library/std/src/sys/unix/net.rs +++ b/library/std/src/sys/unix/net.rs @@ -490,6 +490,7 @@ pub fn as_raw(&self) -> RawFd { } impl AsInner for Socket { + #[inline] fn as_inner(&self) -> &FileDesc { &self.0 } @@ -514,6 +515,7 @@ fn as_fd(&self) -> BorrowedFd<'_> { } impl AsRawFd for Socket { + #[inline] fn as_raw_fd(&self) -> RawFd { self.0.as_raw_fd() } diff --git a/library/std/src/sys/unix/os_str.rs b/library/std/src/sys/unix/os_str.rs index 017e2af29d4..488217f3941 100644 --- a/library/std/src/sys/unix/os_str.rs +++ b/library/std/src/sys/unix/os_str.rs @@ -89,6 +89,7 @@ fn into_inner(self) -> Vec { } impl AsInner<[u8]> for Buf { + #[inline] fn as_inner(&self) -> &[u8] { &self.inner } diff --git a/library/std/src/sys/unix/pipe.rs b/library/std/src/sys/unix/pipe.rs index dc17c9fac46..938a46bfdd8 100644 --- a/library/std/src/sys/unix/pipe.rs +++ b/library/std/src/sys/unix/pipe.rs @@ -135,6 +135,7 @@ fn read(fd: &FileDesc, dst: &mut Vec) -> Result { } impl AsRawFd for AnonPipe { + #[inline] fn as_raw_fd(&self) -> RawFd { self.0.as_raw_fd() } diff --git a/library/std/src/sys/wasi/fd.rs b/library/std/src/sys/wasi/fd.rs index 191db4b60f7..9a8b2a0be5b 100644 --- a/library/std/src/sys/wasi/fd.rs +++ b/library/std/src/sys/wasi/fd.rs @@ -275,12 +275,14 @@ pub fn sock_shutdown(&self, how: Shutdown) -> io::Result<()> { } impl AsInner for WasiFd { + #[inline] fn as_inner(&self) -> &OwnedFd { &self.fd } } impl AsInnerMut for WasiFd { + #[inline] fn as_inner_mut(&mut self) -> &mut OwnedFd { &mut self.fd } @@ -305,6 +307,7 @@ fn as_fd(&self) -> BorrowedFd<'_> { } impl AsRawFd for WasiFd { + #[inline] fn as_raw_fd(&self) -> RawFd { self.fd.as_raw_fd() } diff --git a/library/std/src/sys/wasi/fs.rs b/library/std/src/sys/wasi/fs.rs index 3a205267e34..8d1dbf59155 100644 --- a/library/std/src/sys/wasi/fs.rs +++ b/library/std/src/sys/wasi/fs.rs @@ -498,6 +498,7 @@ pub fn read_link(&self, file: &Path) -> io::Result { } impl AsInner for File { + #[inline] fn as_inner(&self) -> &WasiFd { &self.fd } @@ -522,6 +523,7 @@ fn as_fd(&self) -> BorrowedFd<'_> { } impl AsRawFd for File { + #[inline] fn as_raw_fd(&self) -> RawFd { self.fd.as_raw_fd() } diff --git a/library/std/src/sys/wasi/net.rs b/library/std/src/sys/wasi/net.rs index 59d94a3686d..2239880ffbe 100644 --- a/library/std/src/sys/wasi/net.rs +++ b/library/std/src/sys/wasi/net.rs @@ -17,6 +17,7 @@ pub struct TcpStream { } impl AsInner for Socket { + #[inline] fn as_inner(&self) -> &WasiFd { &self.0 } @@ -41,6 +42,7 @@ fn as_fd(&self) -> BorrowedFd<'_> { } impl AsRawFd for Socket { + #[inline] fn as_raw_fd(&self) -> RawFd { self.0.as_raw_fd() } @@ -184,6 +186,7 @@ pub fn set_nonblocking(&self, state: bool) -> io::Result<()> { } } + #[inline] pub fn socket(&self) -> &Socket { &self.inner } @@ -274,6 +277,7 @@ pub fn set_nonblocking(&self, state: bool) -> io::Result<()> { } } + #[inline] pub fn socket(&self) -> &Socket { &self.inner } @@ -284,6 +288,7 @@ pub fn into_socket(self) -> Socket { } impl AsInner for TcpListener { + #[inline] fn as_inner(&self) -> &Socket { &self.inner } @@ -436,6 +441,7 @@ pub fn connect(&self, _: io::Result<&SocketAddr>) -> io::Result<()> { unsupported() } + #[inline] pub fn socket(&self) -> &Socket { &self.inner } @@ -446,6 +452,7 @@ pub fn into_socket(self) -> Socket { } impl AsInner for UdpSocket { + #[inline] fn as_inner(&self) -> &Socket { &self.inner } diff --git a/library/std/src/sys/windows/fs.rs b/library/std/src/sys/windows/fs.rs index 8ed62cdddcd..f99cdfbecfb 100644 --- a/library/std/src/sys/windows/fs.rs +++ b/library/std/src/sys/windows/fs.rs @@ -832,6 +832,7 @@ fn open_link_no_reparse(parent: &File, name: &[u16], access: u32) -> io::Result< } impl AsInner for File { + #[inline] fn as_inner(&self) -> &Handle { &self.handle } diff --git a/library/std/src/sys/windows/handle.rs b/library/std/src/sys/windows/handle.rs index b290f4070e8..c7677d1c13a 100644 --- a/library/std/src/sys/windows/handle.rs +++ b/library/std/src/sys/windows/handle.rs @@ -34,6 +34,7 @@ pub fn new_event(manual: bool, init: bool) -> io::Result { } impl AsInner for Handle { + #[inline] fn as_inner(&self) -> &OwnedHandle { &self.0 } diff --git a/library/std/src/sys/windows/net.rs b/library/std/src/sys/windows/net.rs index ee1f5482b47..8158713fa84 100644 --- a/library/std/src/sys/windows/net.rs +++ b/library/std/src/sys/windows/net.rs @@ -446,6 +446,7 @@ fn read(&mut self, buf: &mut [u8]) -> io::Result { } impl AsInner for Socket { + #[inline] fn as_inner(&self) -> &OwnedSocket { &self.0 } diff --git a/library/std/src/sys/windows/os_str.rs b/library/std/src/sys/windows/os_str.rs index 4bdd8c505ff..2f2b0e56e08 100644 --- a/library/std/src/sys/windows/os_str.rs +++ b/library/std/src/sys/windows/os_str.rs @@ -27,6 +27,7 @@ fn from_inner(inner: Wtf8Buf) -> Self { } impl AsInner for Buf { + #[inline] fn as_inner(&self) -> &Wtf8 { &self.inner } diff --git a/library/std/src/sys_common/net.rs b/library/std/src/sys_common/net.rs index cb24caa1e8a..652c695fc57 100644 --- a/library/std/src/sys_common/net.rs +++ b/library/std/src/sys_common/net.rs @@ -239,6 +239,7 @@ pub fn connect_timeout(addr: &SocketAddr, timeout: Duration) -> io::Result &Socket { &self.inner } @@ -352,6 +353,7 @@ pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { } impl AsInner for TcpStream { + #[inline] fn as_inner(&self) -> &Socket { &self.inner } @@ -427,6 +429,7 @@ pub fn bind(addr: io::Result<&SocketAddr>) -> io::Result { Ok(TcpListener { inner: sock }) } + #[inline] pub fn socket(&self) -> &Socket { &self.inner } @@ -517,6 +520,7 @@ pub fn bind(addr: io::Result<&SocketAddr>) -> io::Result { Ok(UdpSocket { inner: sock }) } + #[inline] pub fn socket(&self) -> &Socket { &self.inner } diff --git a/library/std/src/sys_common/wtf8.rs b/library/std/src/sys_common/wtf8.rs index bc588bdbb3c..ff96c35fb0b 100644 --- a/library/std/src/sys_common/wtf8.rs +++ b/library/std/src/sys_common/wtf8.rs @@ -501,6 +501,7 @@ pub struct Wtf8 { } impl AsInner<[u8]> for Wtf8 { + #[inline] fn as_inner(&self) -> &[u8] { &self.bytes }