From 25648de28f10799fa6274f64fa12475292231c72 Mon Sep 17 00:00:00 2001 From: Federico Stra Date: Thu, 28 Sep 2023 17:43:01 +0200 Subject: [PATCH] isqrt: disable long running tests in Miri --- library/core/tests/num/int_macros.rs | 4 ++++ library/core/tests/num/uint_macros.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/library/core/tests/num/int_macros.rs b/library/core/tests/num/int_macros.rs index dd0ea5e9238ce..165d9a296176e 100644 --- a/library/core/tests/num/int_macros.rs +++ b/library/core/tests/num/int_macros.rs @@ -299,7 +299,11 @@ macro_rules! int_module { assert_eq!((2 as $T).isqrt(), 1 as $T); assert_eq!((99 as $T).isqrt(), 9 as $T); assert_eq!((100 as $T).isqrt(), 10 as $T); + } + #[cfg(not(miri))] // Miri is too slow + #[test] + fn test_lots_of_isqrt() { let n_max: $T = (1024 * 1024).min($T::MAX as u128) as $T; for n in 0..=n_max { let isqrt: $T = n.isqrt(); diff --git a/library/core/tests/num/uint_macros.rs b/library/core/tests/num/uint_macros.rs index 1ae7d04875709..955440647eb98 100644 --- a/library/core/tests/num/uint_macros.rs +++ b/library/core/tests/num/uint_macros.rs @@ -214,7 +214,11 @@ macro_rules! uint_module { assert_eq!((99 as $T).isqrt(), 9 as $T); assert_eq!((100 as $T).isqrt(), 10 as $T); assert_eq!($T::MAX.isqrt(), (1 << ($T::BITS / 2)) - 1); + } + #[cfg(not(miri))] // Miri is too slow + #[test] + fn test_lots_of_isqrt() { let n_max: $T = (1024 * 1024).min($T::MAX as u128) as $T; for n in 0..=n_max { let isqrt: $T = n.isqrt();