diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-03-31 12:56:42 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-03-31 12:56:51 +0200 |
| commit | 351a20c32fad14760e406e76fab43c8596de694d (patch) | |
| tree | bdbd384f91e763abf4b9dd9c5dcc4ed4506a538e | |
| parent | c5d60910ca81736e498b307dbf7dcea26867f9b1 (diff) | |
| download | rust-351a20c32fad14760e406e76fab43c8596de694d.tar.gz rust-351a20c32fad14760e406e76fab43c8596de694d.zip | |
libstd: deny(elided_lifetimes_in_paths), fixes in sgx
| -rw-r--r-- | src/libstd/sys/sgx/abi/tls.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/sgx/abi/usercalls/alloc.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/sgx/backtrace.rs | 5 | ||||
| -rw-r--r-- | src/libstd/sys/sgx/net.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/sgx/rwlock.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sys/sgx/waitqueue.rs | 14 |
6 files changed, 20 insertions, 19 deletions
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 fcea2752d2c..326737a2418 100644 --- a/src/libstd/sys/sgx/backtrace.rs +++ b/src/libstd/sys/sgx/backtrace.rs @@ -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 { diff --git a/src/libstd/sys/sgx/net.rs b/src/libstd/sys/sgx/net.rs index b103f7e9a40..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 { 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, |
