Skip to content

Commit

Permalink
atomic: Elide lifetime mark in rustc 1.83
Browse files Browse the repository at this point in the history
  • Loading branch information
XuShaohua committed Dec 9, 2024
1 parent f183022 commit 12bafeb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 6 additions & 10 deletions code/atomic_internals/src/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,28 +76,24 @@ impl<L: RawTryLock, T> Lock<L, T> {
}
}

impl<'a, L: RawLock, T> Drop for LockGuard<'a, L, T> {
impl<L: RawLock, T> Drop for LockGuard<'_, L, T> {
fn drop(&mut self) {
unsafe {
self.lock.lock.unlock(self.token.clone());
}
}
}

impl<'a, L: RawLock, T> Deref for LockGuard<'a, L, T> {
impl<L: RawLock, T> Deref for LockGuard<'_, L, T> {
type Target = T;

fn deref(&self) -> &Self::Target {
unsafe {
&*self.lock.data.get()
}
unsafe { &*self.lock.data.get() }
}
}

impl<'a, L: RawLock, T> DerefMut for LockGuard<'a, L, T> {
impl<L: RawLock, T> DerefMut for LockGuard<'_, L, T> {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe {
&mut *self.lock.data.get()
}
unsafe { &mut *self.lock.data.get() }
}
}
}
2 changes: 1 addition & 1 deletion code/structs/src/bin/generic-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ where
least: &'elt T,
}

impl<'elt, T> Extrema<'elt, T>
impl<T> Extrema<'_, T>
where
T: PartialOrd,
{
Expand Down

0 comments on commit 12bafeb

Please sign in to comment.