]> git.proxmox.com Git - rustc.git/blame - library/core/benches/lib.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / library / core / benches / lib.rs
CommitLineData
f035d41b
XL
1// wasm32 does not support benches (no time).
2#![cfg(not(target_arch = "wasm32"))]
8bb4bdeb 3#![feature(flt2dec)]
a7813a04 4#![feature(test)]
04454e1e 5#![feature(trusted_random_access)]
2b03887a 6#![feature(iter_array_chunks)]
487cf647 7#![feature(iter_next_chunk)]
a7813a04
XL
8
9extern crate test;
8bb4bdeb
XL
10
11mod any;
9ffffee4 12mod array;
532ac7d7 13mod ascii;
a1dfa0c6 14mod char;
60c5eb7d 15mod fmt;
8bb4bdeb
XL
16mod hash;
17mod iter;
8bb4bdeb
XL
18mod num;
19mod ops;
60c5eb7d 20mod pattern;
abe05a73 21mod slice;
c295e0f8 22mod str;
353b0b11 23mod tuple;
04454e1e
FG
24
25/// Returns a `rand::Rng` seeded with a consistent seed.
26///
27/// This is done to avoid introducing nondeterminism in benchmark results.
28fn bench_rng() -> rand_xorshift::XorShiftRng {
29 const SEED: [u8; 16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
30 rand::SeedableRng::from_seed(SEED)
31}