diff --git a/src/libstd/sys/wasi/fd.rs b/src/libstd/sys/wasi/fd.rs index 1e05e701759..29e1880b8f1 100644 --- a/src/libstd/sys/wasi/fd.rs +++ b/src/libstd/sys/wasi/fd.rs @@ -23,25 +23,25 @@ pub type RiFlags = u16; pub type RoFlags = u16; pub type SiFlags = u16; -fn iovec(a: &mut [IoVecMut]) -> (*const libc::__wasi_iovec_t, usize) { +fn iovec(a: &mut [IoVecMut<'_>]) -> (*const libc::__wasi_iovec_t, usize) { assert_eq!( - mem::size_of::(), + mem::size_of::>(), mem::size_of::() ); assert_eq!( - mem::align_of::(), + mem::align_of::>(), mem::align_of::() ); (a.as_ptr() as *const libc::__wasi_iovec_t, a.len()) } -fn ciovec(a: &[IoVec]) -> (*const libc::__wasi_ciovec_t, usize) { +fn ciovec(a: &[IoVec<'_>]) -> (*const libc::__wasi_ciovec_t, usize) { assert_eq!( - mem::size_of::(), + mem::size_of::>(), mem::size_of::() ); assert_eq!( - mem::align_of::(), + mem::align_of::>(), mem::align_of::() ); (a.as_ptr() as *const libc::__wasi_ciovec_t, a.len()) @@ -56,28 +56,28 @@ impl WasiFd { cvt_wasi(unsafe { libc::__wasi_fd_datasync(self.fd) }) } - pub fn pread(&self, bufs: &mut [IoVecMut], offset: u64) -> io::Result { + pub fn pread(&self, bufs: &mut [IoVecMut<'_>], offset: u64) -> io::Result { let mut read = 0; let (ptr, len) = iovec(bufs); cvt_wasi(unsafe { libc::__wasi_fd_pread(self.fd, ptr, len, offset, &mut read) })?; Ok(read) } - pub fn pwrite(&self, bufs: &[IoVec], offset: u64) -> io::Result { + pub fn pwrite(&self, bufs: &[IoVec<'_>], offset: u64) -> io::Result { let mut read = 0; let (ptr, len) = ciovec(bufs); cvt_wasi(unsafe { libc::__wasi_fd_pwrite(self.fd, ptr, len, offset, &mut read) })?; Ok(read) } - pub fn read(&self, bufs: &mut [IoVecMut]) -> io::Result { + pub fn read(&self, bufs: &mut [IoVecMut<'_>]) -> io::Result { let mut read = 0; let (ptr, len) = iovec(bufs); cvt_wasi(unsafe { libc::__wasi_fd_read(self.fd, ptr, len, &mut read) })?; Ok(read) } - pub fn write(&self, bufs: &[IoVec]) -> io::Result { + pub fn write(&self, bufs: &[IoVec<'_>]) -> io::Result { let mut read = 0; let (ptr, len) = ciovec(bufs); cvt_wasi(unsafe { libc::__wasi_fd_write(self.fd, ptr, len, &mut read) })?; @@ -281,7 +281,7 @@ impl WasiFd { pub fn sock_recv( &self, - ri_data: &mut [IoVecMut], + ri_data: &mut [IoVecMut<'_>], ri_flags: RiFlags, ) -> io::Result<(usize, RoFlags)> { let mut ro_datalen = 0; @@ -293,7 +293,7 @@ impl WasiFd { Ok((ro_datalen, ro_flags)) } - pub fn sock_send(&self, si_data: &[IoVec], si_flags: SiFlags) -> io::Result { + pub fn sock_send(&self, si_data: &[IoVec<'_>], si_flags: SiFlags) -> io::Result { let mut so_datalen = 0; let (ptr, len) = ciovec(si_data); cvt_wasi(unsafe { libc::__wasi_sock_send(self.fd, ptr, len, si_flags, &mut so_datalen) })?; diff --git a/src/libstd/sys/wasi/fs.rs b/src/libstd/sys/wasi/fs.rs index 485d2c87fbd..68c8e9356a8 100644 --- a/src/libstd/sys/wasi/fs.rs +++ b/src/libstd/sys/wasi/fs.rs @@ -82,7 +82,7 @@ impl Eq for FilePermissions { } impl fmt::Debug for FilePermissions { - fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.0 {} } } @@ -125,13 +125,13 @@ impl Hash for FileType { } impl fmt::Debug for FileType { - fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.0 {} } } impl fmt::Debug for ReadDir { - fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.0 {} } } @@ -236,7 +236,7 @@ impl DirBuilder { } impl fmt::Debug for File { - fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.0 {} } } diff --git a/src/libstd/sys/wasi/net.rs b/src/libstd/sys/wasi/net.rs index af9a22f5b7a..1579aa4b572 100644 --- a/src/libstd/sys/wasi/net.rs +++ b/src/libstd/sys/wasi/net.rs @@ -94,7 +94,7 @@ impl TcpStream { } impl fmt::Debug for TcpStream { - fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.0 {} } } @@ -144,7 +144,7 @@ impl TcpListener { } impl fmt::Debug for TcpListener { - fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.0 {} } } @@ -282,7 +282,7 @@ impl UdpSocket { } impl fmt::Debug for UdpSocket { - fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.0 {} } } diff --git a/src/libstd/sys/wasi/os.rs b/src/libstd/sys/wasi/os.rs index de18e4ba950..6d4d6aae61b 100644 --- a/src/libstd/sys/wasi/os.rs +++ b/src/libstd/sys/wasi/os.rs @@ -41,7 +41,7 @@ pub fn chdir(_: &path::Path) -> io::Result<()> { pub struct SplitPaths<'a>(&'a Void); -pub fn split_paths(_unparsed: &OsStr) -> SplitPaths { +pub fn split_paths(_unparsed: &OsStr) -> SplitPaths<'_> { panic!("unsupported") } @@ -62,7 +62,7 @@ pub fn join_paths(_paths: I) -> Result } impl fmt::Display for JoinPathsError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { "not supported on wasm yet".fmt(f) } } diff --git a/src/libstd/sys/wasi/path.rs b/src/libstd/sys/wasi/path.rs index 5c062e7c97c..7a183956107 100644 --- a/src/libstd/sys/wasi/path.rs +++ b/src/libstd/sys/wasi/path.rs @@ -11,7 +11,7 @@ pub fn is_verbatim_sep(b: u8) -> bool { b == b'/' } -pub fn parse_prefix(_: &OsStr) -> Option { +pub fn parse_prefix(_: &OsStr) -> Option> { None } diff --git a/src/libstd/sys/wasi/process.rs b/src/libstd/sys/wasi/process.rs index c49daaa1632..a02e009d953 100644 --- a/src/libstd/sys/wasi/process.rs +++ b/src/libstd/sys/wasi/process.rs @@ -73,7 +73,7 @@ impl From for Stdio { } impl fmt::Debug for Command { - fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { Ok(()) } } @@ -108,13 +108,13 @@ impl Eq for ExitStatus { } impl fmt::Debug for ExitStatus { - fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.0 {} } } impl fmt::Display for ExitStatus { - fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.0 {} } }