diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-03-01 09:34:11 +0100 | 
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-03-31 12:56:51 +0200 | 
| commit | 379c380a60e7b3adb6c6f595222cbfa2d9160a20 (patch) | |
| tree | f61f13cb864088ab83185775b34837c20211ce93 /src/libstd/sys_common/remutex.rs | |
| parent | cee58fdc12bea8cc373366bd84fc786277729b1c (diff) | |
| download | rust-379c380a60e7b3adb6c6f595222cbfa2d9160a20.tar.gz rust-379c380a60e7b3adb6c6f595222cbfa2d9160a20.zip  | |
libstd: deny(elided_lifetimes_in_paths)
Diffstat (limited to 'src/libstd/sys_common/remutex.rs')
| -rw-r--r-- | src/libstd/sys_common/remutex.rs | 10 | 
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libstd/sys_common/remutex.rs b/src/libstd/sys_common/remutex.rs index 2aec361d7a4..f08b13c4aa2 100644 --- a/src/libstd/sys_common/remutex.rs +++ b/src/libstd/sys_common/remutex.rs @@ -72,7 +72,7 @@ impl<T> ReentrantMutex<T> { /// If another user of this mutex panicked while holding the mutex, then /// this call will return failure if the mutex would otherwise be /// acquired. - pub fn lock(&self) -> LockResult<ReentrantMutexGuard<T>> { + pub fn lock(&self) -> LockResult<ReentrantMutexGuard<'_, T>> { unsafe { self.inner.lock() } ReentrantMutexGuard::new(&self) } @@ -89,7 +89,7 @@ impl<T> ReentrantMutex<T> { /// If another user of this mutex panicked while holding the mutex, then /// this call will return failure if the mutex would otherwise be /// acquired. - pub fn try_lock(&self) -> TryLockResult<ReentrantMutexGuard<T>> { + pub fn try_lock(&self) -> TryLockResult<ReentrantMutexGuard<'_, T>> { if unsafe { self.inner.try_lock() } { Ok(ReentrantMutexGuard::new(&self)?) } else { @@ -108,7 +108,7 @@ impl<T> Drop for ReentrantMutex<T> { } impl<T: fmt::Debug + 'static> fmt::Debug for ReentrantMutex<T> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.try_lock() { Ok(guard) => f.debug_struct("ReentrantMutex").field("data", &*guard).finish(), Err(TryLockError::Poisoned(err)) => { @@ -117,7 +117,9 @@ impl<T: fmt::Debug + 'static> fmt::Debug for ReentrantMutex<T> { Err(TryLockError::WouldBlock) => { struct LockedPlaceholder; impl fmt::Debug for LockedPlaceholder { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("<locked>") } + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str("<locked>") + } } f.debug_struct("ReentrantMutex").field("data", &LockedPlaceholder).finish()  | 
