about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFederico Stra <stra.federico@gmail.com>2023-09-28 17:43:01 +0200
committerFederico Stra <stra.federico@gmail.com>2023-09-28 17:43:01 +0200
commit25648de28f10799fa6274f64fa12475292231c72 (patch)
treec9d6b3a1be0fee6c751fe7090fd21a1374fd7fb5
parentfcdfd5b0b9efcf7797b0f1bf7e7ed47ff99de198 (diff)
downloadrust-25648de28f10799fa6274f64fa12475292231c72.tar.gz
rust-25648de28f10799fa6274f64fa12475292231c72.zip
isqrt: disable long running tests in Miri
-rw-r--r--library/core/tests/num/int_macros.rs4
-rw-r--r--library/core/tests/num/uint_macros.rs4
2 files changed, 8 insertions, 0 deletions
diff --git a/library/core/tests/num/int_macros.rs b/library/core/tests/num/int_macros.rs
index dd0ea5e9238..165d9a29617 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 1ae7d048757..955440647eb 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();