Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 3 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ exclude = ["benches", "distr_test"]
rand_core = { version = "0.10.0-rc-3", default-features = false }
log = { version = "0.4.4", optional = true }
serde = { version = "1.0.103", features = ["derive"], optional = true }
chacha20 = { version = "0.10.0-rc.6", default-features = false, features = ["rng"], optional = true }
chacha20 = { path = "rand_chacha", optional = true, package = "rand_chacha" }
getrandom = { version = "0.4.0-rc.0", optional = true }

[dev-dependencies]
Expand All @@ -85,3 +85,7 @@ rand_pcg = { path = "rand_pcg", version = "0.10.0-rc.1" }
postcard = {version = "1.1.3", default-features = false, features = ["alloc"]}
rayon = "1.7"
serde_json = "1.0.140"

[patch.crates-io]
rand_core = { git = "https://github.com/rust-random/rand_core.git", branch = "merge_rng_traits" }
getrandom = { git = "https://github.com/rust-random/getrandom.git", branch = "try-rng" }
28 changes: 3 additions & 25 deletions benches/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ harness = false
[[bench]]
name = "weighted"
harness = false

[patch.crates-io]
rand_core = { git = "https://github.com/rust-random/rand_core.git", branch = "merge_rng_traits" }
getrandom = { git = "https://github.com/rust-random/getrandom.git", branch = "try-rng" }
2 changes: 1 addition & 1 deletion benches/benches/seq_choose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub fn bench(c: &mut Criterion) {
bench_rng::<rand_pcg::Pcg64>(c, "Pcg64");
}

fn bench_rng<Rng: RngCore + SeedableRng>(c: &mut Criterion, rng_name: &'static str) {
fn bench_rng<Rng: InfallibleRng + SeedableRng>(c: &mut Criterion, rng_name: &'static str) {
for length in [1, 2, 3, 10, 100, 1000].map(black_box) {
let name = format!("choose_size-hinted_from_{length}_{rng_name}");
c.bench_function(name.as_str(), |b| {
Expand Down
2 changes: 1 addition & 1 deletion benches/benches/shuffle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn bench(c: &mut Criterion) {
bench_rng::<rand_pcg::Pcg64>(c, "Pcg64");
}

fn bench_rng<Rng: RngCore + SeedableRng>(c: &mut Criterion, rng_name: &'static str) {
fn bench_rng<Rng: InfallibleRng + SeedableRng>(c: &mut Criterion, rng_name: &'static str) {
for length in [1, 2, 3, 10, 100, 1000, 10000].map(black_box) {
c.bench_function(format!("shuffle_{length}_{rng_name}").as_str(), |b| {
let mut rng = Rng::seed_from_u64(123);
Expand Down
2 changes: 1 addition & 1 deletion examples/print-next.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rand::RngCore;
use rand::Rng;

fn main() {
let mut rng = rand::rng();
Expand Down
Loading
Loading