cargo / rand
rand
What changed in rand 0.8 to 0.10, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
23 breaking2 security1 deprecations8 new APIs and options2 performance1 tooling6 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initrand 0.1041 changes
Breaking changes 22
Applies #[must_use] to partial_shuffle, so unused results are flagged by the compiler.
ChaCha types used directly are now from chacha20 instead of rand_chacha, which may require API changes.
Fill is now implemented for element types rather than sliceable types.
SliceChooseIter is renamed to IndexedSamples.
The minimum supported Rust version is now 1.85.
The unused nightly feature has been removed.
On UEFI targets, raw_os_error now returns Option<usize>.
The dependency behind StdRng changed from rand_chacha to chacha20; output remains the same, but directly using ChaCha types may involve API breakage.
ReseedingRng has been removed.
ReseedingRng no longer supports Clone; the type is also removed.
Rng is renamed to RngExt, following rand_core's rename of RngCore to Rng.
RngReader replaces TryRngCore::read_adapter(..) -> RngReadAdapter with a simpler struct.
IndexedRandom::choose_multiple and IteratorRandom::choose_multiple are renamed to sample.
IndexedRandom::choose_multiple_array is renamed to sample_array.
IteratorRandom::choose_multiple_fill is renamed to sample_fill.
IndexedRandom::choose_multiple_weighted is renamed to sample_weighted.
SeedableRng::from_os_rng and try_from_os_rng have been removed.
The small_rng feature has been removed.
StdRng no longer supports Clone.
os_rng is renamed to sys_rng.
OsError is renamed to SysError.
OsRng is renamed to SysRng.
Security 2
Fixes a possible memory safety violation when deserializing UniformChar from a bad source.
Rand is unsound with a custom logger using rand::rng()
Deprecations 1
The log feature is deprecated.
New APIs and options 8
ChaCha12Rng is now publicly exported behind the chacha feature.
ChaCha20Rng is now publicly exported behind the chacha feature.
ChaCha8Rng is now publicly exported behind the chacha feature.
Adds IndexedRandom::choose_iter.
Adds IndexedRandom::choose_weighted_iter.
Adds rand::make_rng() for R where R: SeedableRng.
Xoshiro128PlusPlus is now publicly exported.
Xoshiro256PlusPlus is now publicly exported.
Performance 2
Reports exact remaining lengths and reduces overhead when reading weights.
Avoids excessive allocation when amount is much larger than the iterator size.
Tooling 1
The project now uses Edition 2024.
Fixes and other changes 5
Deserialized UniformDuration state is validated to avoid panics and ~infinite loops.
Prevents a possible panic when sampling a deserialized Uniform<char>.
Avoids spurious Error::NonFinite errors on large finite float ranges such as 0.0..=f64::MAX.
Returns Error::Overflow instead of panicking when the sum of float weights is infinite.
Adds #[track_caller] so panics from make_rng report the caller’s location.
rand 0.82 changes
Breaking changes 1
The experimental simd_support feature is dropped.
Fixes and other changes 1
Fixed the build with no-std and serde1 enabled.