mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
1db7f690b1
Stabilize integer logarithms Stabilizes feature `int_log`. I've also made the functions const stable, because they don't depend on any unstable const features. `rustc_allow_const_fn_unstable` is just there for `Option::expect`, which could be replaced with a `match` and `panic!`. cc ``@rust-lang/wg-const-eval`` closes https://github.com/rust-lang/rust/issues/70887 (tracking issue) ~~blocked on FCP finishing: https://github.com/rust-lang/rust/issues/70887#issuecomment-1289028216~~ FCP finished: https://github.com/rust-lang/rust/issues/70887#issuecomment-1302121266
30 lines
656 B
Rust
30 lines
656 B
Rust
// wasm32 does not support benches (no time).
|
|
#![cfg(not(target_arch = "wasm32"))]
|
|
#![feature(flt2dec)]
|
|
#![feature(test)]
|
|
#![feature(trusted_random_access)]
|
|
#![feature(iter_array_chunks)]
|
|
#![feature(iter_next_chunk)]
|
|
|
|
extern crate test;
|
|
|
|
mod any;
|
|
mod ascii;
|
|
mod char;
|
|
mod fmt;
|
|
mod hash;
|
|
mod iter;
|
|
mod num;
|
|
mod ops;
|
|
mod pattern;
|
|
mod slice;
|
|
mod str;
|
|
|
|
/// Returns a `rand::Rng` seeded with a consistent seed.
|
|
///
|
|
/// This is done to avoid introducing nondeterminism in benchmark results.
|
|
fn bench_rng() -> rand_xorshift::XorShiftRng {
|
|
const SEED: [u8; 16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
|
|
rand::SeedableRng::from_seed(SEED)
|
|
}
|