diff options
Diffstat (limited to 'src/libstd/sys')
50 files changed, 144 insertions, 142 deletions
diff --git a/src/libstd/sys/cloudabi/backtrace.rs b/src/libstd/sys/cloudabi/backtrace.rs index a15d2238e55..17719a29b6e 100644 --- a/src/libstd/sys/cloudabi/backtrace.rs +++ b/src/libstd/sys/cloudabi/backtrace.rs @@ -24,7 +24,7 @@ impl Error for UnwindError { } impl fmt::Display for UnwindError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}: {:?}", self.description(), self.0) } } @@ -33,8 +33,9 @@ impl fmt::Display for UnwindError { // tracing pub fn unwind_backtrace(frames: &mut [Frame]) -> io::Result<(usize, BacktraceContext)> { let mut cx = Context { idx: 0, frames }; - let result_unwind = - unsafe { uw::_Unwind_Backtrace(trace_fn, &mut cx as *mut Context as *mut libc::c_void) }; + let result_unwind = unsafe { + uw::_Unwind_Backtrace(trace_fn, &mut cx as *mut Context<'_> as *mut libc::c_void) + }; // See libunwind:src/unwind/Backtrace.c for the return values. // No, there is no doc. match result_unwind { @@ -54,7 +55,7 @@ extern "C" fn trace_fn( ctx: *mut uw::_Unwind_Context, arg: *mut libc::c_void, ) -> uw::_Unwind_Reason_Code { - let cx = unsafe { &mut *(arg as *mut Context) }; + let cx = unsafe { &mut *(arg as *mut Context<'_>) }; if cx.idx >= cx.frames.len() { return uw::_URC_NORMAL_STOP; } diff --git a/src/libstd/sys/cloudabi/shims/fs.rs b/src/libstd/sys/cloudabi/shims/fs.rs index 56667bef007..ee045b8e515 100644 --- a/src/libstd/sys/cloudabi/shims/fs.rs +++ b/src/libstd/sys/cloudabi/shims/fs.rs @@ -81,7 +81,7 @@ impl PartialEq for FilePermissions { 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 {} } } @@ -123,13 +123,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 {} } } @@ -234,7 +234,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/cloudabi/shims/net.rs b/src/libstd/sys/cloudabi/shims/net.rs index 4364a136544..7cf23748e1b 100644 --- a/src/libstd/sys/cloudabi/shims/net.rs +++ b/src/libstd/sys/cloudabi/shims/net.rs @@ -97,7 +97,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 {} } } @@ -147,7 +147,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 {} } } @@ -281,7 +281,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/cloudabi/shims/os.rs b/src/libstd/sys/cloudabi/shims/os.rs index 0c4690e12b0..944b9525b3b 100644 --- a/src/libstd/sys/cloudabi/shims/os.rs +++ b/src/libstd/sys/cloudabi/shims/os.rs @@ -34,7 +34,7 @@ pub fn unsetenv(_: &OsStr) -> io::Result<()> { pub struct SplitPaths<'a>(&'a Void); -pub fn split_paths(_unparsed: &OsStr) -> SplitPaths { +pub fn split_paths(_unparsed: &OsStr) -> SplitPaths<'_> { panic!("unsupported") } @@ -57,7 +57,7 @@ where } 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 CloudABI yet".fmt(f) } } diff --git a/src/libstd/sys/cloudabi/shims/process.rs b/src/libstd/sys/cloudabi/shims/process.rs index 710c42c1149..e719b362cbf 100644 --- a/src/libstd/sys/cloudabi/shims/process.rs +++ b/src/libstd/sys/cloudabi/shims/process.rs @@ -71,7 +71,7 @@ impl From<File> 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(()) } } @@ -105,13 +105,13 @@ impl PartialEq for ExitStatus { 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 {} } } diff --git a/src/libstd/sys/redox/backtrace/tracing.rs b/src/libstd/sys/redox/backtrace/tracing.rs index e7a68eadbde..13f34338fd3 100644 --- a/src/libstd/sys/redox/backtrace/tracing.rs +++ b/src/libstd/sys/redox/backtrace/tracing.rs @@ -21,7 +21,7 @@ impl Error for UnwindError { } impl fmt::Display for UnwindError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}: {:?}", self.description(), self.0) } } @@ -37,7 +37,7 @@ pub fn unwind_backtrace(frames: &mut [Frame]) }; let result_unwind = unsafe { uw::_Unwind_Backtrace(trace_fn, - &mut cx as *mut Context + &mut cx as *mut Context<'_> as *mut libc::c_void) }; // See libunwind:src/unwind/Backtrace.c for the return values. @@ -57,7 +57,7 @@ pub fn unwind_backtrace(frames: &mut [Frame]) extern fn trace_fn(ctx: *mut uw::_Unwind_Context, arg: *mut libc::c_void) -> uw::_Unwind_Reason_Code { - let cx = unsafe { &mut *(arg as *mut Context) }; + let cx = unsafe { &mut *(arg as *mut Context<'_>) }; if cx.idx >= cx.frames.len() { return uw::_URC_NORMAL_STOP; } diff --git a/src/libstd/sys/redox/ext/net.rs b/src/libstd/sys/redox/ext/net.rs index 2c121787804..096d0681959 100644 --- a/src/libstd/sys/redox/ext/net.rs +++ b/src/libstd/sys/redox/ext/net.rs @@ -90,7 +90,7 @@ impl SocketAddr { } #[stable(feature = "unix_socket_redox", since = "1.29")] impl fmt::Debug for SocketAddr { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { write!(fmt, "SocketAddr") } } @@ -114,7 +114,7 @@ pub struct UnixStream(FileDesc); #[stable(feature = "unix_socket_redox", since = "1.29")] impl fmt::Debug for UnixStream { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { let mut builder = fmt.debug_struct("UnixStream"); builder.field("fd", &self.0.raw()); if let Ok(addr) = self.local_addr() { @@ -503,7 +503,7 @@ pub struct UnixListener(FileDesc); #[stable(feature = "unix_socket_redox", since = "1.29")] impl fmt::Debug for UnixListener { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { let mut builder = fmt.debug_struct("UnixListener"); builder.field("fd", &self.0.raw()); if let Ok(addr) = self.local_addr() { diff --git a/src/libstd/sys/redox/fs.rs b/src/libstd/sys/redox/fs.rs index 159ee9911bd..3ef9925705f 100644 --- a/src/libstd/sys/redox/fs.rs +++ b/src/libstd/sys/redox/fs.rs @@ -123,7 +123,7 @@ impl FromInner<u32> for FilePermissions { } impl fmt::Debug for ReadDir { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // This will only be called from std::fs::ReadDir, which will add a "ReadDir()" frame. // Thus the result will be e g 'ReadDir("/home")' fmt::Debug::fmt(&*self.root, f) @@ -341,7 +341,7 @@ impl FromInner<usize> for File { } impl fmt::Debug for File { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let mut b = f.debug_struct("File"); b.field("fd", &self.0.raw()); if let Ok(path) = self.path() { diff --git a/src/libstd/sys/redox/os.rs b/src/libstd/sys/redox/os.rs index 76e43a83b73..3ae201f698c 100644 --- a/src/libstd/sys/redox/os.rs +++ b/src/libstd/sys/redox/os.rs @@ -58,7 +58,7 @@ pub struct SplitPaths<'a> { fn(&'a [u8]) -> PathBuf>, } -pub fn split_paths(unparsed: &OsStr) -> SplitPaths { +pub fn split_paths(unparsed: &OsStr) -> SplitPaths<'_> { fn bytes_to_path(b: &[u8]) -> PathBuf { PathBuf::from(<OsStr as OsStrExt>::from_bytes(b)) } @@ -97,7 +97,7 @@ pub fn join_paths<I, T>(paths: I) -> Result<OsString, JoinPathsError> } impl fmt::Display for JoinPathsError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { "path segment contains separator `:`".fmt(f) } } diff --git a/src/libstd/sys/redox/path.rs b/src/libstd/sys/redox/path.rs index 618d61e6fcb..b62d6c98782 100644 --- a/src/libstd/sys/redox/path.rs +++ b/src/libstd/sys/redox/path.rs @@ -11,7 +11,7 @@ pub fn is_verbatim_sep(b: u8) -> bool { b == b'/' } -pub fn parse_prefix(path: &OsStr) -> Option<Prefix> { +pub fn parse_prefix(path: &OsStr) -> Option<Prefix<'_>> { if let Some(path_str) = path.to_str() { if let Some(_i) = path_str.find(':') { // FIXME: Redox specific prefix diff --git a/src/libstd/sys/redox/process.rs b/src/libstd/sys/redox/process.rs index 8830cdf333e..8e6f50773ab 100644 --- a/src/libstd/sys/redox/process.rs +++ b/src/libstd/sys/redox/process.rs @@ -492,7 +492,7 @@ impl ChildStdio { } impl fmt::Debug for Command { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{:?}", self.program)?; for arg in &self.args { write!(f, " {:?}", arg)?; @@ -542,7 +542,7 @@ impl From<i32> for ExitStatus { } impl fmt::Display for ExitStatus { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if let Some(code) = self.code() { write!(f, "exit code: {}", code) } else { diff --git a/src/libstd/sys/redox/syscall/error.rs b/src/libstd/sys/redox/syscall/error.rs index f5b7bf75f30..da84ffb0423 100644 --- a/src/libstd/sys/redox/syscall/error.rs +++ b/src/libstd/sys/redox/syscall/error.rs @@ -38,13 +38,13 @@ impl Error { } impl fmt::Debug for Error { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.text()) } } impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.text()) } } diff --git a/src/libstd/sys/redox/time.rs b/src/libstd/sys/redox/time.rs index 881ad5c0aeb..081437459cc 100644 --- a/src/libstd/sys/redox/time.rs +++ b/src/libstd/sys/redox/time.rs @@ -151,7 +151,7 @@ impl Instant { } impl fmt::Debug for Instant { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Instant") .field("tv_sec", &self.t.t.tv_sec) .field("tv_nsec", &self.t.t.tv_nsec) @@ -185,7 +185,7 @@ impl From<syscall::TimeSpec> for SystemTime { } impl fmt::Debug for SystemTime { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("SystemTime") .field("tv_sec", &self.t.t.tv_sec) .field("tv_nsec", &self.t.t.tv_nsec) diff --git a/src/libstd/sys/sgx/abi/tls.rs b/src/libstd/sys/sgx/abi/tls.rs index 6b9ab7e383c..fa82e8ccf05 100644 --- a/src/libstd/sys/sgx/abi/tls.rs +++ b/src/libstd/sys/sgx/abi/tls.rs @@ -84,7 +84,7 @@ impl Tls { Tls { data: dup!((* * * * * * *) (Cell::new(ptr::null_mut()))) } } - pub unsafe fn activate(&self) -> ActiveTls { + pub unsafe fn activate(&self) -> ActiveTls<'_> { set_tls_ptr(self as *const Tls as _); ActiveTls { tls: self } } @@ -141,7 +141,7 @@ mod sync_bitset { } /// Not atomic. - pub fn iter(&self) -> SyncBitsetIter { + pub fn iter(&self) -> SyncBitsetIter<'_> { SyncBitsetIter { iter: self.0.iter().enumerate().peekable(), elem_idx: 0, diff --git a/src/libstd/sys/sgx/abi/usercalls/alloc.rs b/src/libstd/sys/sgx/abi/usercalls/alloc.rs index 449a5fe5ae3..ec9c30a3e4f 100644 --- a/src/libstd/sys/sgx/abi/usercalls/alloc.rs +++ b/src/libstd/sys/sgx/abi/usercalls/alloc.rs @@ -429,7 +429,7 @@ impl<T> UserRef<[T]> where [T]: UserSafe { } /// Returns an iterator over the slice. - pub fn iter(&self) -> Iter<T> + pub fn iter(&self) -> Iter<'_, T> where T: UserSafe // FIXME: should be implied by [T]: UserSafe? { unsafe { @@ -438,7 +438,7 @@ impl<T> UserRef<[T]> where [T]: UserSafe { } /// Returns an iterator that allows modifying each value. - pub fn iter_mut(&mut self) -> IterMut<T> + pub fn iter_mut(&mut self) -> IterMut<'_, T> where T: UserSafe // FIXME: should be implied by [T]: UserSafe? { unsafe { diff --git a/src/libstd/sys/sgx/backtrace.rs b/src/libstd/sys/sgx/backtrace.rs index d0361574e39..326737a2418 100644 --- a/src/libstd/sys/sgx/backtrace.rs +++ b/src/libstd/sys/sgx/backtrace.rs @@ -23,7 +23,7 @@ impl Error for UnwindError { } impl fmt::Display for UnwindError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}: {:?}", self.description(), self.0) } } @@ -31,8 +31,9 @@ impl fmt::Display for UnwindError { #[inline(never)] // this function call can be skipped it when tracing. pub fn unwind_backtrace(frames: &mut [Frame]) -> io::Result<(usize, BacktraceContext)> { let mut cx = Context { idx: 0, frames }; - let result_unwind = - unsafe { uw::_Unwind_Backtrace(trace_fn, &mut cx as *mut Context as *mut libc::c_void) }; + let result_unwind = unsafe { + uw::_Unwind_Backtrace(trace_fn, &mut cx as *mut Context<'_> as *mut libc::c_void) + }; // See libunwind:src/unwind/Backtrace.c for the return values. // No, there is no doc. let res = match result_unwind { @@ -53,7 +54,7 @@ extern "C" fn trace_fn( ctx: *mut uw::_Unwind_Context, arg: *mut libc::c_void, ) -> uw::_Unwind_Reason_Code { - let cx = unsafe { &mut *(arg as *mut Context) }; + let cx = unsafe { &mut *(arg as *mut Context<'_>) }; if cx.idx >= cx.frames.len() { return uw::_URC_NORMAL_STOP; } diff --git a/src/libstd/sys/sgx/fs.rs b/src/libstd/sys/sgx/fs.rs index 485d2c87fbd..68c8e9356a8 100644 --- a/src/libstd/sys/sgx/fs.rs +++ b/src/libstd/sys/sgx/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/sgx/net.rs b/src/libstd/sys/sgx/net.rs index 0e7602a906e..10cc644a55e 100644 --- a/src/libstd/sys/sgx/net.rs +++ b/src/libstd/sys/sgx/net.rs @@ -48,7 +48,7 @@ pub struct TcpStream { } impl fmt::Debug for TcpStream { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let mut res = f.debug_struct("TcpStream"); if let Some(ref addr) = self.inner.local_addr { @@ -213,7 +213,7 @@ pub struct TcpListener { } impl fmt::Debug for TcpListener { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let mut res = f.debug_struct("TcpListener"); if let Some(ref addr) = self.inner.local_addr { @@ -421,7 +421,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 {} } } @@ -438,7 +438,7 @@ impl error::Error for NonIpSockAddr { } impl fmt::Display for NonIpSockAddr { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "Failed to convert address to SocketAddr: {}", self.host) } } diff --git a/src/libstd/sys/sgx/os.rs b/src/libstd/sys/sgx/os.rs index 0bb7b897058..8b12c49edba 100644 --- a/src/libstd/sys/sgx/os.rs +++ b/src/libstd/sys/sgx/os.rs @@ -37,7 +37,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") } @@ -58,7 +58,7 @@ pub fn join_paths<I, T>(_paths: I) -> Result<OsString, JoinPathsError> } 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 in SGX yet".fmt(f) } } diff --git a/src/libstd/sys/sgx/path.rs b/src/libstd/sys/sgx/path.rs index 1115de1fbe5..b5fd7e3ae6d 100644 --- a/src/libstd/sys/sgx/path.rs +++ b/src/libstd/sys/sgx/path.rs @@ -11,7 +11,7 @@ pub fn is_verbatim_sep(b: u8) -> bool { b == b'/' } -pub fn parse_prefix(_: &OsStr) -> Option<Prefix> { +pub fn parse_prefix(_: &OsStr) -> Option<Prefix<'_>> { None } diff --git a/src/libstd/sys/sgx/process.rs b/src/libstd/sys/sgx/process.rs index c49daaa1632..a02e009d953 100644 --- a/src/libstd/sys/sgx/process.rs +++ b/src/libstd/sys/sgx/process.rs @@ -73,7 +73,7 @@ impl From<File> 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 {} } } diff --git a/src/libstd/sys/sgx/rwlock.rs b/src/libstd/sys/sgx/rwlock.rs index 784303f3a65..4cba36aa64d 100644 --- a/src/libstd/sys/sgx/rwlock.rs +++ b/src/libstd/sys/sgx/rwlock.rs @@ -93,8 +93,8 @@ impl RWLock { #[inline] unsafe fn __read_unlock( &self, - mut rguard: SpinMutexGuard<WaitVariable<Option<NonZeroUsize>>>, - wguard: SpinMutexGuard<WaitVariable<bool>>, + mut rguard: SpinMutexGuard<'_, WaitVariable<Option<NonZeroUsize>>>, + wguard: SpinMutexGuard<'_, WaitVariable<bool>>, ) { *rguard.lock_var_mut() = NonZeroUsize::new(rguard.lock_var().unwrap().get() - 1); if rguard.lock_var().is_some() { @@ -120,8 +120,8 @@ impl RWLock { #[inline] unsafe fn __write_unlock( &self, - rguard: SpinMutexGuard<WaitVariable<Option<NonZeroUsize>>>, - wguard: SpinMutexGuard<WaitVariable<bool>>, + rguard: SpinMutexGuard<'_, WaitVariable<Option<NonZeroUsize>>>, + wguard: SpinMutexGuard<'_, WaitVariable<bool>>, ) { if let Err(mut wguard) = WaitQueue::notify_one(wguard) { // No writers waiting, release the write lock diff --git a/src/libstd/sys/sgx/waitqueue.rs b/src/libstd/sys/sgx/waitqueue.rs index 3f5e03ddad6..f4adb7d1e16 100644 --- a/src/libstd/sys/sgx/waitqueue.rs +++ b/src/libstd/sys/sgx/waitqueue.rs @@ -140,7 +140,7 @@ impl WaitQueue { /// until a wakeup event. /// /// This function does not return until this thread has been awoken. - pub fn wait<T>(mut guard: SpinMutexGuard<WaitVariable<T>>) { + pub fn wait<T>(mut guard: SpinMutexGuard<'_, WaitVariable<T>>) { unsafe { let mut entry = UnsafeListEntry::new(SpinMutex::new(WaitEntry { tcs: thread::current(), @@ -162,8 +162,8 @@ impl WaitQueue { /// /// If a waiter is found, a `WaitGuard` is returned which will notify the /// waiter when it is dropped. - pub fn notify_one<T>(mut guard: SpinMutexGuard<WaitVariable<T>>) - -> Result<WaitGuard<T>, SpinMutexGuard<WaitVariable<T>>> + pub fn notify_one<T>(mut guard: SpinMutexGuard<'_, WaitVariable<T>>) + -> Result<WaitGuard<'_, T>, SpinMutexGuard<'_, WaitVariable<T>>> { unsafe { if let Some(entry) = guard.queue.inner.pop() { @@ -186,8 +186,8 @@ impl WaitQueue { /// /// If at least one waiter is found, a `WaitGuard` is returned which will /// notify all waiters when it is dropped. - pub fn notify_all<T>(mut guard: SpinMutexGuard<WaitVariable<T>>) - -> Result<WaitGuard<T>, SpinMutexGuard<WaitVariable<T>>> + pub fn notify_all<T>(mut guard: SpinMutexGuard<'_, WaitVariable<T>>) + -> Result<WaitGuard<'_, T>, SpinMutexGuard<'_, WaitVariable<T>>> { unsafe { let mut count = 0; @@ -433,7 +433,7 @@ mod spin_mutex { } #[inline(always)] - pub fn lock(&self) -> SpinMutexGuard<T> { + pub fn lock(&self) -> SpinMutexGuard<'_, T> { loop { match self.try_lock() { None => while self.lock.load(Ordering::Relaxed) { @@ -445,7 +445,7 @@ mod spin_mutex { } #[inline(always)] - pub fn try_lock(&self) -> Option<SpinMutexGuard<T>> { + pub fn try_lock(&self) -> Option<SpinMutexGuard<'_, T>> { if !self.lock.compare_and_swap(false, true, Ordering::Acquire) { Some(SpinMutexGuard { mutex: self, diff --git a/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs b/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs index abbeca0fde6..e6379132baf 100644 --- a/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs +++ b/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs @@ -21,7 +21,7 @@ impl Error for UnwindError { } impl fmt::Display for UnwindError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}: {:?}", self.description(), self.0) } } @@ -37,7 +37,7 @@ pub fn unwind_backtrace(frames: &mut [Frame]) }; let result_unwind = unsafe { uw::_Unwind_Backtrace(trace_fn, - &mut cx as *mut Context + &mut cx as *mut Context<'_> as *mut libc::c_void) }; // See libunwind:src/unwind/Backtrace.c for the return values. @@ -57,7 +57,7 @@ pub fn unwind_backtrace(frames: &mut [Frame]) extern fn trace_fn(ctx: *mut uw::_Unwind_Context, arg: *mut libc::c_void) -> uw::_Unwind_Reason_Code { - let cx = unsafe { &mut *(arg as *mut Context) }; + let cx = unsafe { &mut *(arg as *mut Context<'_>) }; if cx.idx >= cx.frames.len() { return uw::_URC_NORMAL_STOP; } diff --git a/src/libstd/sys/unix/ext/net.rs b/src/libstd/sys/unix/ext/net.rs index 4fc79efe7ce..406863a6cba 100644 --- a/src/libstd/sys/unix/ext/net.rs +++ b/src/libstd/sys/unix/ext/net.rs @@ -219,7 +219,7 @@ impl SocketAddr { #[stable(feature = "unix_socket", since = "1.10.0")] impl fmt::Debug for SocketAddr { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { match self.address() { AddressKind::Unnamed => write!(fmt, "(unnamed)"), AddressKind::Abstract(name) => write!(fmt, "{} (abstract)", AsciiEscaped(name)), @@ -231,7 +231,7 @@ impl fmt::Debug for SocketAddr { struct AsciiEscaped<'a>(&'a [u8]); impl<'a> fmt::Display for AsciiEscaped<'a> { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { write!(fmt, "\"")?; for byte in self.0.iter().cloned().flat_map(ascii::escape_default) { write!(fmt, "{}", byte as char)?; @@ -259,7 +259,7 @@ pub struct UnixStream(Socket); #[stable(feature = "unix_socket", since = "1.10.0")] impl fmt::Debug for UnixStream { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { let mut builder = fmt.debug_struct("UnixStream"); builder.field("fd", self.0.as_inner()); if let Ok(addr) = self.local_addr() { @@ -719,7 +719,7 @@ pub struct UnixListener(Socket); #[stable(feature = "unix_socket", since = "1.10.0")] impl fmt::Debug for UnixListener { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { let mut builder = fmt.debug_struct("UnixListener"); builder.field("fd", self.0.as_inner()); if let Ok(addr) = self.local_addr() { @@ -998,7 +998,7 @@ pub struct UnixDatagram(Socket); #[stable(feature = "unix_socket", since = "1.10.0")] impl fmt::Debug for UnixDatagram { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { let mut builder = fmt.debug_struct("UnixDatagram"); builder.field("fd", self.0.as_inner()); if let Ok(addr) = self.local_addr() { diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index c73f7983146..a36dae2f5a1 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -206,7 +206,7 @@ impl FromInner<u32> for FilePermissions { } impl fmt::Debug for ReadDir { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // This will only be called from std::fs::ReadDir, which will add a "ReadDir()" frame. // Thus the result will be e g 'ReadDir("/home")' fmt::Debug::fmt(&*self.inner.root, f) @@ -627,7 +627,7 @@ impl FromInner<c_int> for File { } impl fmt::Debug for File { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { #[cfg(target_os = "linux")] fn get_path(fd: c_int) -> Option<PathBuf> { let mut p = PathBuf::from("/proc/self/fd"); diff --git a/src/libstd/sys/unix/l4re.rs b/src/libstd/sys/unix/l4re.rs index b3dd1cf6aaa..f52fe807090 100644 --- a/src/libstd/sys/unix/l4re.rs +++ b/src/libstd/sys/unix/l4re.rs @@ -212,7 +212,7 @@ pub mod net { } impl fmt::Debug for TcpStream { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "No networking support available on L4Re") } } @@ -274,7 +274,7 @@ pub mod net { } impl fmt::Debug for TcpListener { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "No networking support available on L4Re.") } } @@ -424,7 +424,7 @@ pub mod net { } impl fmt::Debug for UdpSocket { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "No networking support on L4Re available.") } } diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs index e16d50d437b..726b17969b7 100644 --- a/src/libstd/sys/unix/os.rs +++ b/src/libstd/sys/unix/os.rs @@ -152,7 +152,7 @@ pub struct SplitPaths<'a> { fn(&'a [u8]) -> PathBuf>, } -pub fn split_paths(unparsed: &OsStr) -> SplitPaths { +pub fn split_paths(unparsed: &OsStr) -> SplitPaths<'_> { fn bytes_to_path(b: &[u8]) -> PathBuf { PathBuf::from(<OsStr as OsStrExt>::from_bytes(b)) } @@ -191,7 +191,7 @@ pub fn join_paths<I, T>(paths: I) -> Result<OsString, JoinPathsError> } impl fmt::Display for JoinPathsError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { "path segment contains separator `:`".fmt(f) } } diff --git a/src/libstd/sys/unix/path.rs b/src/libstd/sys/unix/path.rs index 5c062e7c97c..7a183956107 100644 --- a/src/libstd/sys/unix/path.rs +++ b/src/libstd/sys/unix/path.rs @@ -11,7 +11,7 @@ pub fn is_verbatim_sep(b: u8) -> bool { b == b'/' } -pub fn parse_prefix(_: &OsStr) -> Option<Prefix> { +pub fn parse_prefix(_: &OsStr) -> Option<Prefix<'_>> { None } diff --git a/src/libstd/sys/unix/process/process_common.rs b/src/libstd/sys/unix/process/process_common.rs index 856d202be03..f6a12a16396 100644 --- a/src/libstd/sys/unix/process/process_common.rs +++ b/src/libstd/sys/unix/process/process_common.rs @@ -330,7 +330,7 @@ impl ChildStdio { } impl fmt::Debug for Command { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{:?}", self.program)?; for arg in &self.args { write!(f, " {:?}", arg)?; @@ -380,7 +380,7 @@ impl From<c_int> for ExitStatus { } impl fmt::Display for ExitStatus { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if let Some(code) = self.code() { write!(f, "exit code: {}", code) } else { diff --git a/src/libstd/sys/unix/time.rs b/src/libstd/sys/unix/time.rs index 6b5a89aee7d..127ae6aa104 100644 --- a/src/libstd/sys/unix/time.rs +++ b/src/libstd/sys/unix/time.rs @@ -213,7 +213,7 @@ mod inner { } impl fmt::Debug for SystemTime { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("SystemTime") .field("tv_sec", &self.t.t.tv_sec) .field("tv_nsec", &self.t.t.tv_nsec) @@ -298,7 +298,7 @@ mod inner { } impl fmt::Debug for Instant { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Instant") .field("tv_sec", &self.t.t.tv_sec) .field("tv_nsec", &self.t.t.tv_nsec) @@ -332,7 +332,7 @@ mod inner { } impl fmt::Debug for SystemTime { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("SystemTime") .field("tv_sec", &self.t.t.tv_sec) .field("tv_nsec", &self.t.t.tv_nsec) 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::<IoVecMut>(), + mem::size_of::<IoVecMut<'_>>(), mem::size_of::<libc::__wasi_iovec_t>() ); assert_eq!( - mem::align_of::<IoVecMut>(), + mem::align_of::<IoVecMut<'_>>(), mem::align_of::<libc::__wasi_iovec_t>() ); (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::<IoVec>(), + mem::size_of::<IoVec<'_>>(), mem::size_of::<libc::__wasi_ciovec_t>() ); assert_eq!( - mem::align_of::<IoVec>(), + mem::align_of::<IoVec<'_>>(), mem::align_of::<libc::__wasi_ciovec_t>() ); (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<usize> { + pub fn pread(&self, bufs: &mut [IoVecMut<'_>], offset: u64) -> io::Result<usize> { 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<usize> { + pub fn pwrite(&self, bufs: &[IoVec<'_>], offset: u64) -> io::Result<usize> { 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<usize> { + pub fn read(&self, bufs: &mut [IoVecMut<'_>]) -> io::Result<usize> { 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<usize> { + pub fn write(&self, bufs: &[IoVec<'_>]) -> io::Result<usize> { 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<usize> { + pub fn sock_send(&self, si_data: &[IoVec<'_>], si_flags: SiFlags) -> io::Result<usize> { 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<I, T>(_paths: I) -> Result<OsString, JoinPathsError> } 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<Prefix> { +pub fn parse_prefix(_: &OsStr) -> Option<Prefix<'_>> { 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<File> 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 {} } } diff --git a/src/libstd/sys/wasm/fs.rs b/src/libstd/sys/wasm/fs.rs index 485d2c87fbd..68c8e9356a8 100644 --- a/src/libstd/sys/wasm/fs.rs +++ b/src/libstd/sys/wasm/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/wasm/net.rs b/src/libstd/sys/wasm/net.rs index c85dd000afe..38552eab0a6 100644 --- a/src/libstd/sys/wasm/net.rs +++ b/src/libstd/sys/wasm/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/wasm/os.rs b/src/libstd/sys/wasm/os.rs index 145f9ccd73a..5d21999a991 100644 --- a/src/libstd/sys/wasm/os.rs +++ b/src/libstd/sys/wasm/os.rs @@ -24,7 +24,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") } @@ -45,7 +45,7 @@ pub fn join_paths<I, T>(_paths: I) -> Result<OsString, JoinPathsError> } 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/wasm/path.rs b/src/libstd/sys/wasm/path.rs index 5c062e7c97c..7a183956107 100644 --- a/src/libstd/sys/wasm/path.rs +++ b/src/libstd/sys/wasm/path.rs @@ -11,7 +11,7 @@ pub fn is_verbatim_sep(b: u8) -> bool { b == b'/' } -pub fn parse_prefix(_: &OsStr) -> Option<Prefix> { +pub fn parse_prefix(_: &OsStr) -> Option<Prefix<'_>> { None } diff --git a/src/libstd/sys/wasm/process.rs b/src/libstd/sys/wasm/process.rs index c49daaa1632..a02e009d953 100644 --- a/src/libstd/sys/wasm/process.rs +++ b/src/libstd/sys/wasm/process.rs @@ -73,7 +73,7 @@ impl From<File> 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 {} } } diff --git a/src/libstd/sys/windows/args.rs b/src/libstd/sys/windows/args.rs index 3f10e6e5983..b04bb484eed 100644 --- a/src/libstd/sys/windows/args.rs +++ b/src/libstd/sys/windows/args.rs @@ -164,13 +164,13 @@ pub struct ArgsInnerDebug<'a> { } impl<'a> fmt::Debug for ArgsInnerDebug<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.args.parsed_args_list.as_slice().fmt(f) } } impl Args { - pub fn inner_debug(&self) -> ArgsInnerDebug { + pub fn inner_debug(&self) -> ArgsInnerDebug<'_> { ArgsInnerDebug { args: self } diff --git a/src/libstd/sys/windows/ext/ffi.rs b/src/libstd/sys/windows/ext/ffi.rs index 547b1ef796b..1381825806f 100644 --- a/src/libstd/sys/windows/ext/ffi.rs +++ b/src/libstd/sys/windows/ext/ffi.rs @@ -131,12 +131,12 @@ pub trait OsStrExt { /// /// [`OsString::from_wide`]: ./trait.OsStringExt.html#tymethod.from_wide #[stable(feature = "rust1", since = "1.0.0")] - fn encode_wide(&self) -> EncodeWide; + fn encode_wide(&self) -> EncodeWide<'_>; } #[stable(feature = "rust1", since = "1.0.0")] impl OsStrExt for OsStr { - fn encode_wide(&self) -> EncodeWide { + fn encode_wide(&self) -> EncodeWide<'_> { self.as_inner().inner.encode_wide() } } diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs index daf8aae24dd..4ebbb0707f7 100644 --- a/src/libstd/sys/windows/fs.rs +++ b/src/libstd/sys/windows/fs.rs @@ -74,7 +74,7 @@ pub struct FilePermissions { attrs: c::DWORD } pub struct DirBuilder; impl fmt::Debug for ReadDir { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // This will only be called from std::fs::ReadDir, which will add a "ReadDir()" frame. // Thus the result will be e g 'ReadDir("C:\")' fmt::Debug::fmt(&*self.root, f) @@ -435,7 +435,7 @@ impl FromInner<c::HANDLE> for File { } impl fmt::Debug for File { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // FIXME(#24570): add more info here (e.g., mode) let mut b = f.debug_struct("File"); b.field("handle", &self.handle.raw()); diff --git a/src/libstd/sys/windows/os.rs b/src/libstd/sys/windows/os.rs index 5b433ddfb4a..4e50b5521eb 100644 --- a/src/libstd/sys/windows/os.rs +++ b/src/libstd/sys/windows/os.rs @@ -136,7 +136,7 @@ pub struct SplitPaths<'a> { must_yield: bool, } -pub fn split_paths(unparsed: &OsStr) -> SplitPaths { +pub fn split_paths(unparsed: &OsStr) -> SplitPaths<'_> { SplitPaths { data: unparsed.encode_wide(), must_yield: true, @@ -212,7 +212,7 @@ pub fn join_paths<I, T>(paths: I) -> Result<OsString, JoinPathsError> } impl fmt::Display for JoinPathsError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { "path segment contains `\"`".fmt(f) } } diff --git a/src/libstd/sys/windows/os_str.rs b/src/libstd/sys/windows/os_str.rs index 8befa66ecdc..c7a82e09252 100644 --- a/src/libstd/sys/windows/os_str.rs +++ b/src/libstd/sys/windows/os_str.rs @@ -33,13 +33,13 @@ impl AsInner<Wtf8> for Buf { } impl fmt::Debug for Buf { - fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { fmt::Debug::fmt(self.as_slice(), formatter) } } impl fmt::Display for Buf { - fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { fmt::Display::fmt(self.as_slice(), formatter) } } @@ -49,13 +49,13 @@ pub struct Slice { } impl fmt::Debug for Slice { - fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { fmt::Debug::fmt(&self.inner, formatter) } } impl fmt::Display for Slice { - fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { fmt::Display::fmt(&self.inner, formatter) } } @@ -139,7 +139,7 @@ impl Slice { self.inner.as_str() } - pub fn to_string_lossy(&self) -> Cow<str> { + pub fn to_string_lossy(&self) -> Cow<'_, str> { self.inner.to_string_lossy() } diff --git a/src/libstd/sys/windows/path.rs b/src/libstd/sys/windows/path.rs index b8532ca9b0d..f3178a5e9e6 100644 --- a/src/libstd/sys/windows/path.rs +++ b/src/libstd/sys/windows/path.rs @@ -19,7 +19,7 @@ pub fn is_verbatim_sep(b: u8) -> bool { b == b'\\' } -pub fn parse_prefix<'a>(path: &'a OsStr) -> Option<Prefix> { +pub fn parse_prefix<'a>(path: &'a OsStr) -> Option<Prefix<'a>> { use crate::path::Prefix::*; unsafe { // The unsafety here stems from converting between &OsStr and &[u8] diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index 95f061d22bd..e39b7ae8890 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -219,7 +219,7 @@ impl Command { } impl fmt::Debug for Command { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{:?}", self.program)?; for arg in &self.args { write!(f, " {:?}", arg)?; @@ -393,7 +393,7 @@ impl From<c::DWORD> for ExitStatus { } impl fmt::Display for ExitStatus { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // Windows exit codes with the high bit set typically mean some form of // unhandled exception or warning. In this scenario printing the exit // code in decimal doesn't always make sense because it's a very large diff --git a/src/libstd/sys/windows/time.rs b/src/libstd/sys/windows/time.rs index aa53f1194fd..4c9d2aee157 100644 --- a/src/libstd/sys/windows/time.rs +++ b/src/libstd/sys/windows/time.rs @@ -139,7 +139,7 @@ impl Ord for SystemTime { } impl fmt::Debug for SystemTime { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("SystemTime") .field("intervals", &self.intervals()) .finish() |
