Skip to content

Commit

Permalink
Remove unused test trait impls
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromfedricci committed Apr 7, 2024
1 parent 312552a commit 7f3df02
Showing 1 changed file with 3 additions and 28 deletions.
31 changes: 3 additions & 28 deletions src/thread_local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ impl LocalMutexNode {
/// called directly by user's code. It is subjected to changes **WITHOUT**
/// prior notice or accompanied with relevant SemVer changes.
#[cfg(not(all(loom, test)))]
#[cfg(not(tarpaulin_include))]
#[doc(hidden)]
#[must_use]
#[inline(always)]
Expand Down Expand Up @@ -583,6 +584,7 @@ impl<T: ?Sized, R: Relax> Mutex<T, R> {
/// });
/// });
/// ```
#[cfg(not(tarpaulin_include))]
const fn __guard_cant_escape_closure() {}
}

Expand Down Expand Up @@ -627,6 +629,7 @@ impl<T: ?Sized, R> Mutex<T, R> {

// A thread local node definition used for testing.
#[cfg(test)]
#[cfg(not(tarpaulin_include))]
thread_local_node!(static TEST_NODE);

/// A Mutex wrapper type that calls the `lock_with_local` and
Expand All @@ -646,20 +649,6 @@ impl<T: ?Sized, R> crate::test::LockNew for MutexPanic<T, R> {
}
}

#[cfg(all(not(loom), test))]
impl<T: ?Sized, R> crate::test::LockData for MutexPanic<T, R> {
fn into_inner(self) -> Self::Target
where
Self::Target: Sized,
{
self.0.into_inner()
}

fn get_mut(&mut self) -> &mut Self::Target {
self.0.get_mut()
}
}

#[cfg(test)]
impl<T: ?Sized, R: Relax> crate::test::LockWith for MutexPanic<T, R> {
type Guard<'a> = MutexGuard<'a, Self::Target, R>
Expand Down Expand Up @@ -703,20 +692,6 @@ impl<T: ?Sized, R> crate::test::LockNew for MutexUnchecked<T, R> {
}
}

#[cfg(all(not(loom), test))]
impl<T: ?Sized, R> crate::test::LockData for MutexUnchecked<T, R> {
fn into_inner(self) -> Self::Target
where
Self::Target: Sized,
{
self.0.into_inner()
}

fn get_mut(&mut self) -> &mut Self::Target {
self.0.get_mut()
}
}

#[cfg(test)]
impl<T: ?Sized, R: Relax> crate::test::LockWith for MutexUnchecked<T, R> {
type Guard<'a> = MutexGuard<'a, Self::Target, R>
Expand Down

0 comments on commit 7f3df02

Please sign in to comment.