unstale

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 init

@unstale/cli on npm

rand 0.1041 changes

Breaking changes 22

  • Applies #[must_use] to partial_shuffle, so unused results are flagged by the compiler.

    0.10.2release notes

  • ChaCha types used directly are now from chacha20 instead of rand_chacha, which may require API changes.

    0.10.0release notes

  • Fill is now implemented for element types rather than sliceable types.

    0.10.0release notes

  • SliceChooseIter is renamed to IndexedSamples.

    0.10.0release notes

  • The minimum supported Rust version is now 1.85.

    0.10.0release notes

  • The unused nightly feature has been removed.

    0.10.0release notes

  • On UEFI targets, raw_os_error now returns Option<usize>.

    0.10.0release notes

  • The dependency behind StdRng changed from rand_chacha to chacha20; output remains the same, but directly using ChaCha types may involve API breakage.

    0.10.0release notes

  • ReseedingRng has been removed.

    0.10.0release notes

  • ReseedingRng no longer supports Clone; the type is also removed.

    0.10.0release notes

  • Rng is renamed to RngExt, following rand_core's rename of RngCore to Rng.

    0.10.0release notes

  • RngReader replaces TryRngCore::read_adapter(..) -> RngReadAdapter with a simpler struct.

    0.10.0release notes

  • IndexedRandom::choose_multiple and IteratorRandom::choose_multiple are renamed to sample.

    0.10.0release notes

  • IndexedRandom::choose_multiple_array is renamed to sample_array.

    0.10.0release notes

  • IteratorRandom::choose_multiple_fill is renamed to sample_fill.

    0.10.0release notes

  • IndexedRandom::choose_multiple_weighted is renamed to sample_weighted.

    0.10.0release notes

  • SeedableRng::from_os_rng and try_from_os_rng have been removed.

    0.10.0release notes

  • The small_rng feature has been removed.

    0.10.0release notes

  • StdRng no longer supports Clone.

    0.10.0release notes

  • os_rng is renamed to sys_rng.

    0.10.0release notes

  • OsError is renamed to SysError.

    0.10.0release notes

  • OsRng is renamed to SysRng.

    0.10.0release notes

Security 2

  • Fixes a possible memory safety violation when deserializing UniformChar from a bad source.

    0.10.2release notes

  • Rand is unsound with a custom logger using rand::rng()

    0.8.6, 0.9.3, 0.10.1security advisory

Deprecations 1

New APIs and options 8

  • ChaCha12Rng is now publicly exported behind the chacha feature.

    0.10.0release notes

  • ChaCha20Rng is now publicly exported behind the chacha feature.

    0.10.0release notes

  • ChaCha8Rng is now publicly exported behind the chacha feature.

    0.10.0release notes

  • Adds IndexedRandom::choose_iter.

    0.10.0release notes

  • Adds IndexedRandom::choose_weighted_iter.

    0.10.0release notes

  • Adds rand::make_rng() for R where R: SeedableRng.

    0.10.0release notes

  • Xoshiro128PlusPlus is now publicly exported.

    0.10.0release notes

  • Xoshiro256PlusPlus is now publicly exported.

    0.10.0release notes

Performance 2

  • Reports exact remaining lengths and reduces overhead when reading weights.

    0.10.3release notes

  • Avoids excessive allocation when amount is much larger than the iterator size.

    0.10.0release notes

Tooling 1

Fixes and other changes 5

  • Deserialized UniformDuration state is validated to avoid panics and ~infinite loops.

    0.10.4release notes

  • Prevents a possible panic when sampling a deserialized Uniform<char>.

    0.10.3release notes

  • Avoids spurious Error::NonFinite errors on large finite float ranges such as 0.0..=f64::MAX.

    0.10.3release notes

  • Returns Error::Overflow instead of panicking when the sum of float weights is infinite.

    0.10.3release notes

  • Adds #[track_caller] so panics from make_rng report the caller’s location.

    0.10.1release notes

rand 0.82 changes

Breaking changes 1

  • The experimental simd_support feature is dropped.

    0.8.6release notes

Fixes and other changes 1

  • Fixed the build with no-std and serde1 enabled.

    0.8.8release notes