aboutsummaryrefslogtreecommitdiff
path: root/tests/sort-panic-safe.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sort-panic-safe.rs')
-rw-r--r--tests/sort-panic-safe.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/sort-panic-safe.rs b/tests/sort-panic-safe.rs
index 00a9731..95ef88d 100644
--- a/tests/sort-panic-safe.rs
+++ b/tests/sort-panic-safe.rs
@@ -8,11 +8,12 @@ use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering::Relaxed;
use std::thread;
-static VERSIONS: AtomicUsize = AtomicUsize::new(0);
+const ZERO: AtomicUsize = AtomicUsize::new(0);
+const LEN: usize = 20_000;
-lazy_static::lazy_static! {
- static ref DROP_COUNTS: Vec<AtomicUsize> = (0..20_000).map(|_| AtomicUsize::new(0)).collect();
-}
+static VERSIONS: AtomicUsize = ZERO;
+
+static DROP_COUNTS: [AtomicUsize; LEN] = [ZERO; LEN];
#[derive(Clone, Eq)]
struct DropCounter {
@@ -117,6 +118,7 @@ macro_rules! test {
thread_local!(static SILENCE_PANIC: Cell<bool> = Cell::new(false));
#[test]
+#[cfg_attr(any(target_os = "emscripten", target_family = "wasm"), ignore)]
fn sort_panic_safe() {
let prev = panic::take_hook();
panic::set_hook(Box::new(move |info| {