Skip to content

Commit 98a1aaf

Browse files
authored
Merge pull request #1076 from dhardy/work
Rand v0.8, rand_distr v0.4
2 parents cc93dae + 46082d5 commit 98a1aaf

File tree

7 files changed

+64
-37
lines changed

7 files changed

+64
-37
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
target: x86_64-unknown-linux-gnu
5050
toolchain: 1.36.0 # MSRV
5151
- os: ubuntu-latest
52-
deps: sudo apt install gcc-multilib
52+
deps: sudo apt-get update ; sudo apt install gcc-multilib
5353
target: i686-unknown-linux-gnu
5454
toolchain: nightly
5555
- os: ubuntu-latest

CHANGELOG.md

+51-26
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,61 @@ A [separate changelog is kept for rand_core](rand_core/CHANGELOG.md).
88

99
You may also find the [Upgrade Guide](https://rust-random.github.io/book/update.html) useful.
1010

11-
## [Unreleased]
12-
### Additions
13-
- impl PartialEq+Eq for StdRng, SmallRng, and StepRng (#975)
14-
- Added a `serde1` feature and added Serialize/Deserialize to `UniformInt` and `WeightedIndex` (#974)
15-
- Document types supported by `random` (#994)
16-
- Implement weighted sampling without replacement (#976, #1013)
17-
- Add `IteratorRandom::choose_stable` as an alternative to `choose` which does not depend on size hints (#1057)
18-
19-
### Changes
20-
- `getrandom` updated to v0.2 (#1041)
21-
- `ThreadRng` is no longer `Copy` to enable safe usage within thread-local destructors (see #968)
22-
- `gen_range(a, b)` was replaced with `gen_range(a..b)`, and `gen_range(a..=b)`
23-
is supported (#744, #1003). Note that `a` and `b` can no longer be references or SIMD types.
24-
- Replace `AsByteSliceMut` with `Fill` (#940)
25-
- Move alias method for `WeightedIndex` to `rand_distr` (#945)
26-
- `Alphanumeric` samples bytes instead of chars (#935)
11+
## [0.8.0] - 2020-12-18
12+
### Platform support
2713
- The minimum supported Rust version is now 1.36 (#1011)
28-
- Restrict `rand::rngs::adapter` to `std` (#1027)
29-
- Better NaN handling for `WeightedIndex` (#1005)
30-
- Implement `IntoIterator` for `IndexVec`, replacing the `into_iter` method (#1007)
31-
- Reduce packaged crate size (#983)
32-
- Drop some unsafe code (#962, #963, #1011)
33-
- Improve treatment of rounding errors in `WeightedIndex::update_weights` (#956)
34-
- `StdRng`: Switch from ChaCha20 to ChaCha12 for better performance (#1028)
35-
- `SmallRng`: Replace PCG algorithm with xoshiro{128,256}++ (#1038)
14+
- `getrandom` updated to v0.2 (#1041)
15+
- Remove `wasm-bindgen` and `stdweb` feature flags. For details of WASM support,
16+
see the [getrandom documentation](https://docs.rs/getrandom/latest). (#948)
17+
- `ReadRng::next_u32` and `next_u64` now use little-Endian conversion instead
18+
of native-Endian, affecting results on Big-Endian platforms (#1061)
3619
- The `nightly` feature no longer implies the `simd_support` feature (#1048)
3720
- Fix `simd_support` feature to work on current nightlies (#1056)
21+
22+
### Rngs
23+
- `ThreadRng` is no longer `Copy` to enable safe usage within thread-local destructors (#1035)
24+
- `gen_range(a, b)` was replaced with `gen_range(a..b)`. `gen_range(a..=b)` is
25+
also supported. Note that `a` and `b` can no longer be references or SIMD types. (#744, #1003)
26+
- Replace `AsByteSliceMut` with `Fill` and add support for `[bool], [char], [f32], [f64]` (#940)
27+
- Restrict `rand::rngs::adapter` to `std` (#1027; see also #928)
28+
- `StdRng`: add new `std_rng` feature flag (enabled by default, but might need
29+
to be used if disabling default crate features) (#948)
30+
- `StdRng`: Switch from ChaCha20 to ChaCha12 for better performance (#1028)
31+
- `SmallRng`: Replace PCG algorithm with xoshiro{128,256}++ (#1038)
32+
33+
### Sequences
34+
- Add `IteratorRandom::choose_stable` as an alternative to `choose` which does
35+
not depend on size hints (#1057)
3836
- Improve accuracy and performance of `IteratorRandom::choose` (#1059)
39-
- `ReadRng::next_u32` and `next_u64` now use little-Endian conversion instead
40-
of native-Endian, affecting results on Big-Endian platforms (#1026)
37+
- Implement `IntoIterator` for `IndexVec`, replacing the `into_iter` method (#1007)
38+
- Add value stability tests for `seq` module (#933)
39+
40+
### Misc
41+
- Support `PartialEq` and `Eq` for `StdRng`, `SmallRng` and `StepRng` (#979)
42+
- Added a `serde1` feature and added Serialize/Deserialize to `UniformInt` and `WeightedIndex` (#974)
43+
- Drop some unsafe code (#962, #963, #1011)
44+
- Reduce packaged crate size (#983)
45+
- Migrate to GitHub Actions from Travis+AppVeyor (#1073)
46+
47+
### Distributions
48+
- `Alphanumeric` samples bytes instead of chars (#935)
49+
- `Uniform` now supports `char`, enabling `rng.gen_range('A'..='Z')` (#1068)
50+
- Add `UniformSampler::sample_single_inclusive` (#1003)
51+
52+
#### Weighted sampling
53+
- Implement weighted sampling without replacement (#976, #1013)
54+
- `rand::distributions::alias_method::WeightedIndex` was moved to `rand_distr::WeightedAliasIndex`.
55+
The simpler alternative `rand::distribution::WeightedIndex` remains. (#945)
56+
- Improve treatment of rounding errors in `WeightedIndex::update_weights` (#956)
57+
- `WeightedIndex`: return error on NaN instead of panic (#1005)
58+
59+
### Documentation
60+
- Document types supported by `random` (#994)
61+
- Document notes on password generation (#995)
62+
- Note that `SmallRng` may not be the best choice for performance and in some
63+
other cases (#1038)
64+
- Use `doc(cfg)` to annotate feature-gated items (#1019)
65+
- Adjust README (#1065)
4166

4267
## [0.7.3] - 2020-01-10
4368
### Fixes

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rand"
3-
version = "0.7.4"
3+
version = "0.8.0"
44
authors = ["The Rand Project Developers", "The Rust Project Developers"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Add this to your `Cargo.toml`:
5151

5252
```toml
5353
[dependencies]
54-
rand = "0.7"
54+
rand = "0.8.0"
5555
```
5656

5757
To get started using Rand, see [The Book](https://rust-random.github.io/book).
@@ -68,7 +68,7 @@ Current Rand versions are:
6868
- Version 0.7 was released in June 2019, moving most non-uniform distributions
6969
to an external crate, moving `from_entropy` to `SeedableRng`, and many small
7070
changes and fixes.
71-
- The `master` branch is close to 0.8 release.
71+
- Version 0.8 was released in December 2020 with many small changes.
7272

7373
A detailed [changelog](CHANGELOG.md) is available for releases.
7474

SECURITY.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ exceptions for theoretical issues without a known exploit:
4343

4444
| Crate | Versions | Exceptions |
4545
| ----- | -------- | ---------- |
46+
| `rand` | 0.8 | |
4647
| `rand` | 0.7 | |
4748
| `rand` | 0.5, 0.6 | Jitter |
4849
| `rand` | 0.4 | Jitter, ISAAC |
49-
| `rand_core` | 0.2 - 0.5 | |
50-
| `rand_chacha` | 0.1 - 0.2 | |
51-
| `rand_hc` | 0.1 - 0.2 | |
50+
| `rand_core` | 0.2 - 0.6 | |
51+
| `rand_chacha` | 0.1 - 0.3 | |
52+
| `rand_hc` | 0.1 - 0.3 | |
5253

5354
Explanation of exceptions:
5455

rand_distr/CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [Unreleased]
7+
## [0.4.0] - 2020-12-18
8+
- Bump `rand` to v0.8.0
89
- New `Geometric`, `StandardGeometric` and `Hypergeometric` distributions (#1062)
910
- New `Beta` sampling algorithm for improved performance and accuracy (#1000)
1011
- `Normal` and `LogNormal` now support `from_mean_cv` and `from_zscore` (#1044)

rand_distr/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rand_distr"
3-
version = "0.2.2"
3+
version = "0.4.0"
44
authors = ["The Rand Project Developers"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"
@@ -16,7 +16,7 @@ edition = "2018"
1616
include = ["src/", "LICENSE-*", "README.md", "CHANGELOG.md", "COPYRIGHT"]
1717

1818
[dependencies]
19-
rand = { path = "..", version = "0.7", default-features = false }
19+
rand = { path = "..", version = "0.8.0", default-features = false }
2020
num-traits = { version = "0.2", default-features = false, features = ["libm"] }
2121

2222
[features]
@@ -27,6 +27,6 @@ alloc = ["rand/alloc"]
2727
[dev-dependencies]
2828
rand_pcg = { version = "0.3.0", path = "../rand_pcg" }
2929
# For inline examples
30-
rand = { path = "..", version = "0.7", default-features = false, features = ["std_rng", "std"] }
30+
rand = { path = "..", version = "0.8.0", default-features = false, features = ["std_rng", "std"] }
3131
# Histogram implementation for testing uniformity
3232
average = "0.10.3"

0 commit comments

Comments
 (0)