]> git.lizzy.rs Git - rust.git/blob - library/core/benches/lib.rs
Rollup merge of #107148 - Ezrashaw:uncode-e0789, r=compiler-errors,GuillaumeGomez
[rust.git] / library / core / benches / lib.rs
1 // wasm32 does not support benches (no time).
2 #![cfg(not(target_arch = "wasm32"))]
3 #![feature(flt2dec)]
4 #![feature(test)]
5 #![feature(trusted_random_access)]
6 #![feature(iter_array_chunks)]
7 #![feature(iter_next_chunk)]
8
9 extern crate test;
10
11 mod any;
12 mod ascii;
13 mod char;
14 mod fmt;
15 mod hash;
16 mod iter;
17 mod num;
18 mod ops;
19 mod pattern;
20 mod slice;
21 mod str;
22
23 /// Returns a `rand::Rng` seeded with a consistent seed.
24 ///
25 /// This is done to avoid introducing nondeterminism in benchmark results.
26 fn bench_rng() -> rand_xorshift::XorShiftRng {
27     const SEED: [u8; 16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
28     rand::SeedableRng::from_seed(SEED)
29 }