From 16d6bd7ece4c4b9b72f6bd51c9b034270b745525 Mon Sep 17 00:00:00 2001 From: Mica White Date: Sun, 13 Sep 2026 15:12:08 -0400 Subject: Support no_std --- tests/evil_mutex.rs | 2 ++ tests/evil_rwlock.rs | 5 +++-- tests/evil_try_mutex.rs | 2 ++ tests/evil_try_rwlock.rs | 2 ++ tests/evil_unlock_mutex.rs | 2 ++ tests/evil_unlock_rwlock.rs | 2 ++ tests/forget.rs | 2 ++ tests/retry.rs | 2 ++ tests/retry_rw.rs | 2 ++ 9 files changed, 19 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/evil_mutex.rs b/tests/evil_mutex.rs index ef6f31a..2eebb86 100755 --- a/tests/evil_mutex.rs +++ b/tests/evil_mutex.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "std")] + use std::sync::Arc; use happylock::collection::{BoxedLockCollection, RetryingLockCollection}; diff --git a/tests/evil_rwlock.rs b/tests/evil_rwlock.rs index a57a27a..679928b 100755 --- a/tests/evil_rwlock.rs +++ b/tests/evil_rwlock.rs @@ -1,10 +1,11 @@ -use std::panic::AssertUnwindSafe; -use std::sync::Arc; +#![cfg(feature = "std")] use happylock::collection::{BoxedLockCollection, RetryingLockCollection}; use happylock::rwlock::RwLock; use happylock::ThreadKey; use lock_api::{GuardNoSend, RawRwLock}; +use std::panic::AssertUnwindSafe; +use std::sync::Arc; struct EvilRwLock { inner: parking_lot::RawRwLock, diff --git a/tests/evil_try_mutex.rs b/tests/evil_try_mutex.rs index 22834be..5978f02 100755 --- a/tests/evil_try_mutex.rs +++ b/tests/evil_try_mutex.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "std")] + use std::sync::Arc; use happylock::{ diff --git a/tests/evil_try_rwlock.rs b/tests/evil_try_rwlock.rs index acba794..9b5db06 100755 --- a/tests/evil_try_rwlock.rs +++ b/tests/evil_try_rwlock.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "std")] + use std::sync::Arc; use happylock::collection::{BoxedLockCollection, RetryingLockCollection}; diff --git a/tests/evil_unlock_mutex.rs b/tests/evil_unlock_mutex.rs index c21fc34..dc35d81 100755 --- a/tests/evil_unlock_mutex.rs +++ b/tests/evil_unlock_mutex.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "std")] + use std::sync::Arc; use happylock::collection::{BoxedLockCollection, RetryingLockCollection}; diff --git a/tests/evil_unlock_rwlock.rs b/tests/evil_unlock_rwlock.rs index 577de85..550ebe3 100755 --- a/tests/evil_unlock_rwlock.rs +++ b/tests/evil_unlock_rwlock.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "std")] + use std::sync::Arc; use happylock::collection::{BoxedLockCollection, RetryingLockCollection}; diff --git a/tests/forget.rs b/tests/forget.rs index 755bdb1..0c74c84 100755 --- a/tests/forget.rs +++ b/tests/forget.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "std")] + use happylock::{Mutex, ThreadKey}; #[test] diff --git a/tests/retry.rs b/tests/retry.rs index 64e0918..f27bd5e 100755 --- a/tests/retry.rs +++ b/tests/retry.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "std")] + use std::time::Duration; use happylock::{collection::RetryingLockCollection, Mutex, ThreadKey}; diff --git a/tests/retry_rw.rs b/tests/retry_rw.rs index 0a946b0..d95d001 100755 --- a/tests/retry_rw.rs +++ b/tests/retry_rw.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "std")] + use std::time::Duration; use happylock::{collection::RetryingLockCollection, RwLock, ThreadKey}; -- cgit v1.3.1