about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/base_n
diff options
context:
space:
mode:
authorNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2022-06-03 22:01:56 +0200
committerNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2022-06-04 17:46:29 +0200
commitfc8b13cb96a5b45bb7028ca0f50d1444f0f95582 (patch)
treea5a0f90a578041dabd1e0dc8ef3e969f366fb10b /compiler/rustc_data_structures/src/base_n
parent44e9516c8535c6f41f2d1c444657cd672b4ab81b (diff)
Adapt rustc_data_structures tests to run in strict miri
Some tests took too long and owning_ref is fundamentally flawed,
so don't run these tests or run them with a shorter N. This makes
miri with `-Zmiri-strict-provenance` usable to find UB.
Diffstat (limited to 'compiler/rustc_data_structures/src/base_n')
-rw-r--r--compiler/rustc_data_structures/src/base_n/tests.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_data_structures/src/base_n/tests.rs b/compiler/rustc_data_structures/src/base_n/tests.rs
index b68ef1eb7f4..2be2f0532c9 100644
--- a/compiler/rustc_data_structures/src/base_n/tests.rs
+++ b/compiler/rustc_data_structures/src/base_n/tests.rs
@@ -15,7 +15,9 @@ fn test_encode() {
         test(u64::MAX as u128, base);
         test(u128::MAX, base);
 
-        for i in 0..1_000 {
+        const N: u128 = if cfg!(miri) { 10 } else { 1000 };
+
+        for i in 0..N {
             test(i * 983, base);
         }
     }