libstd: deny(elided_lifetimes_in_paths), fixes in sgx
This commit is contained in:
parent
c5d60910ca
commit
351a20c32f
@ -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,
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user