From 2efe657c54b7a33a48605a9d28221db62476bf63 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 19 Aug 2020 10:34:19 +0200 Subject: [PATCH] Miri supports threads now --- tests/test.rs | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/tests/test.rs b/tests/test.rs index 18c86fe..fda7260 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -202,32 +202,9 @@ mod unsync { mod sync { use std::sync::atomic::{AtomicUsize, Ordering::SeqCst}; - use once_cell::sync::{Lazy, OnceCell}; - - #[cfg(not(miri))] // miri doesn't support threads - mod scope { - pub(super) use crossbeam_utils::thread::scope; - } + use crossbeam_utils::thread::scope; - #[cfg(miri)] // "stub threads" for Miri - mod scope { - pub(super) struct Scope; - - #[cfg(miri)] - impl Scope { - pub(super) fn spawn(&self, f: impl FnOnce(()) -> R) -> R { - f(()) - } - } - - #[cfg(miri)] - pub(super) fn scope(f: impl FnOnce(&Scope)) -> Result<(), ()> { - f(&Scope); - Ok(()) - } - } - - use scope::scope; + use once_cell::sync::{Lazy, OnceCell}; #[test] fn once_cell() {