Update Rust crate rand to 0.8
This MR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| rand (source) | dependencies | minor |
0.7 -> 0.8
|
Release Notes
rust-random/rand (rand)
v0.8.5
Fixes
- Fix build on non-32/64-bit architectures (#1144)
- Fix "min_const_gen" feature for
no_std(#1173) - Check
libc::pthread_atforkreturn value with panic on error (#1178) - More robust reseeding in case
ReseedingRngis used from a fork handler (#1178) - Fix nightly: remove unused
slice_partition_at_indexfeature (#1215) - Fix nightly +
simd_support: updatepacked_simd(#1216)
Rngs
-
StdRng: Switch from HC128 to ChaCha12 on emscripten (#1142). We now use ChaCha12 on all platforms.
Documentation
v0.8.4
Additions
- Use const-generics to support arrays of all sizes (#1104)
- Implement
CloneandCopyforAlphanumeric(#1126) - Add
Distribution::mapto derive a distribution using a closure (#1129) - Add
Slicedistribution (#1107) - Add
DistStringtrait with impls forStandardandAlphanumeric(#1133)
Other
- Reorder asserts in
Uniformfloat distributions for easier debugging of non-finite arguments (#1094, #1108) - Add range overflow check in
Uniformfloat distributions (#1108) - Deprecate
rngs::adapter::ReadRng(#1130)
v0.8.3
Fixes
- Fix
no-std+allocbuild by gatingchoose_multiple_weightedonstd(#1088)
v0.8.2
Fixes
- Fix panic in
UniformInt::sample_single_inclusiveandRng::gen_rangewhen providing a full integer range (eg0..=MAX) (#1087)
v0.8.1
Other
- Enable all stable features in the playground (#1081)
v0.8.0
Platform support
- The minimum supported Rust version is now 1.36 (#1011)
-
getrandomupdated to v0.2 (#1041) - Remove
wasm-bindgenandstdwebfeature flags. For details of WASM support, see the getrandom documentation. (#948) -
ReadRng::next_u32andnext_u64now use little-Endian conversion instead of native-Endian, affecting results on Big-Endian platforms (#1061) - The
nightlyfeature no longer implies thesimd_supportfeature (#1048) - Fix
simd_supportfeature to work on current nightlies (#1056)
Rngs
-
ThreadRngis no longerCopyto enable safe usage within thread-local destructors (#1035) -
gen_range(a, b)was replaced withgen_range(a..b).gen_range(a..=b)is also supported. Note thataandbcan no longer be references or SIMD types. (#744, #1003) - Replace
AsByteSliceMutwithFilland add support for[bool], [char], [f32], [f64](#940) - Restrict
rand::rngs::adaptertostd(#1027; see also #928) -
StdRng: add newstd_rngfeature flag (enabled by default, but might need to be used if disabling default crate features) (#948) -
StdRng: Switch from ChaCha20 to ChaCha12 for better performance (#1028) -
SmallRng: Replace PCG algorithm with xoshiro{128,256}++ (#1038)
Sequences
- Add
IteratorRandom::choose_stableas an alternative tochoosewhich does not depend on size hints (#1057) - Improve accuracy and performance of
IteratorRandom::choose(#1059) - Implement
IntoIteratorforIndexVec, replacing theinto_itermethod (#1007) - Add value stability tests for
seqmodule (#933)
Misc
- Support
PartialEqandEqforStdRng,SmallRngandStepRng(#979) - Added a
serde1feature and added Serialize/Deserialize toUniformIntandWeightedIndex(#974) - Drop some unsafe code (#962, #963, #1011)
- Reduce packaged crate size (#983)
- Migrate to GitHub Actions from Travis+AppVeyor (#1073)
Distributions
-
Alphanumericsamples bytes instead of chars (#935) -
Uniformnow supportschar, enablingrng.gen_range('A'..='Z')(#1068) - Add
UniformSampler::sample_single_inclusive(#1003)
Weighted sampling
- Implement weighted sampling without replacement (#976, #1013)
-
rand::distributions::alias_method::WeightedIndexwas moved torand_distr::WeightedAliasIndex. The simpler alternativerand::distribution::WeightedIndexremains. (#945) - Improve treatment of rounding errors in
WeightedIndex::update_weights(#956) -
WeightedIndex: return error on NaN instead of panic (#1005)
Documentation
- Document types supported by
random(#994) - Document notes on password generation (#995)
- Note that
SmallRngmay not be the best choice for performance and in some other cases (#1038) - Use
doc(cfg)to annotate feature-gated items (#1019) - Adjust README (#1065)
v0.7.3
Fixes
- The
Bernoullidistribution constructors now reports an error on NaN and ondenominator == 0. (#925) - Use
std::sync::Onceto register fork handler, avoiding possible atomicity violation (#928) - Fix documentation on the precision of generated floating-point values
Changes
- Unix: make libc dependency optional; only use fork protection with std feature (#928)
Additions
- Implement
std::error::ErrorforBernoulliError(#919)
v0.7.2
Fixes
- Fix dependency on
rand_core0.5.1 (#890)
Additions
- Unit tests for value stability of distributions added (#888)
v0.7.1
Yanked
This release was yanked since it depends on rand_core::OsRng added in 0.5.1
but specifies a dependency on version 0.5.0 (#890), causing a broken builds
when updating from rand 0.7.0 without also updating rand_core.
Fixes
- Fix
no_stdbehaviour, appropriately enable c2-chacha'sstdfeature (#844) -
allocfeature inno_stdis available since Rust 1.36 (#856) - Fix or squelch issues from Clippy lints (#840)
Additions
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.