Skip to content

Commit 333404a

Browse files
committed
Merge branch 'master' into def_thread_rng
2 parents 1816f16 + 6add2fd commit 333404a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+2509
-1773
lines changed

.travis.yml

Lines changed: 53 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -51,51 +51,51 @@ sudo: false
5151
# - run benchmarks as tests:
5252
# `cargo test --benches --features=nightly`
5353
# Tests on subcrates:
54-
# `cargo test --package rand_core`
55-
# `cargo test --package rand_core --features=alloc` (requires nightly)
56-
# `cargo test --package rand_core --no-default-features`
57-
# `cargo test --package rand_isaac --features=serde1`
58-
# `cargo test --package rand_xorshift --features=serde1`
54+
# - select crates via --manifest-path (more reliable than --package)
55+
# - test appropriate feature matrix
56+
#
57+
# TODO: SIMD support on stable releases
58+
# NOTE: SIMD support is unreliable on nightly; we track the latest release
5959
matrix:
6060
include:
6161
- rust: 1.22.0
6262
env: DESCRIPTION="pinned stable Rust release"
63-
install:
6463
script:
64+
# Differs from standard script: rand_pcg features
6565
- cargo test --lib --no-default-features
66+
# TODO: add simd_support feature:
6667
- cargo test --features=serde1,log
6768
- cargo test --examples
68-
- cargo test --package rand_core
69-
- cargo test --package rand_core --no-default-features
70-
- cargo test --package rand_isaac --features=serde1
71-
# - cargo test --package rand_xorshift --features=serde1
69+
- cargo test --manifest-path rand_core/Cargo.toml
70+
- cargo test --manifest-path rand_core/Cargo.toml --no-default-features
71+
- cargo test --manifest-path rand_isaac/Cargo.toml --features=serde1
72+
# TODO: cannot test rand_pcg due to explicit dependency on i128
73+
- cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1
74+
- cargo test --manifest-path rand_chacha/Cargo.toml
75+
- cargo test --manifest-path rand_hc/Cargo.toml
7276

7377
- rust: stable
7478
env: DESCRIPTION="stable Rust release, macOS, iOS (cross-compile only)"
7579
os: osx
7680
install:
7781
- rustup target add aarch64-apple-ios
7882
script:
83+
# Differs from standard script: includes aarch64-apple-ios cross-build
7984
- cargo test --lib --no-default-features
80-
- cargo test --features=serde1,log,i128_support
85+
# TODO: add simd_support feature:
86+
- cargo test --features=serde1,log
8187
- cargo test --examples
82-
- cargo test --package rand_core
83-
- cargo test --package rand_core --no-default-features
84-
- cargo test --package rand_isaac --features=serde1
85-
- cargo test --package rand_xorshift --features=serde1
88+
- cargo test --manifest-path rand_core/Cargo.toml
89+
- cargo test --manifest-path rand_core/Cargo.toml --no-default-features
90+
- cargo test --manifest-path rand_isaac/Cargo.toml --features=serde1
91+
- cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1
92+
- cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1
93+
- cargo test --manifest-path rand_chacha/Cargo.toml
94+
- cargo test --manifest-path rand_hc/Cargo.toml
8695
- cargo build --target=aarch64-apple-ios
8796

8897
- rust: beta
8998
env: DESCRIPTION="beta Rust release"
90-
install:
91-
script:
92-
- cargo test --lib --no-default-features
93-
- cargo test --features=serde1,log,i128_support
94-
- cargo test --examples
95-
- cargo test --package rand_core
96-
- cargo test --package rand_core --no-default-features
97-
- cargo test --package rand_isaac --features=serde1
98-
- cargo test --package rand_xorshift --features=serde1
9999

100100
- rust: nightly
101101
env: DESCRIPTION="nightly features, benchmarks, documentation"
@@ -105,14 +105,18 @@ matrix:
105105
before_script:
106106
- pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
107107
script:
108+
# Differs from standard script: alloc feature, all features, doc build
108109
- cargo test --lib --no-default-features --features=alloc
109110
- cargo test --all-features
110111
- cargo test --benches --features=nightly
111112
- cargo test --examples
112-
- cargo test --package rand_core
113-
- cargo test --package rand_core --no-default-features --features=alloc
114-
- cargo test --package rand_isaac --features=serde1
115-
# - cargo test --package rand_xorshift --features=serde1
113+
- cargo test --manifest-path rand_core/Cargo.toml
114+
- cargo test --manifest-path rand_core/Cargo.toml --no-default-features --features=alloc
115+
- cargo test --manifest-path rand_isaac/Cargo.toml --features=serde1
116+
- cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1
117+
- cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1
118+
- cargo test --manifest-path rand_chacha/Cargo.toml
119+
- cargo test --manifest-path rand_hc/Cargo.toml
116120
# remove cached documentation, otherwise files from previous PRs can get included
117121
- rm -rf target/doc
118122
- cargo doc --no-deps --all --all-features
@@ -164,22 +168,38 @@ matrix:
164168
dist: trusty
165169
services: docker
166170
env: DESCRIPTION="Linux (MIPS, big-endian)" TARGET=mips-unknown-linux-gnu
171+
install:
172+
- sh utils/ci/install.sh
173+
- source ~/.cargo/env || true
174+
script:
175+
- bash utils/ci/script.sh
167176
- rust: stable
168177
sudo: required
169178
dist: trusty
170179
services: docker
171180
env: DESCRIPTION="Android (ARMv7)" TARGET=armv7-linux-androideabi
181+
install:
182+
- sh utils/ci/install.sh
183+
- source ~/.cargo/env || true
184+
script:
185+
- bash utils/ci/script.sh
172186

173187
before_install:
174188
- set -e
175189
- rustup self update
176190

177-
# Used by all Trust targets; others must override:
178-
install:
179-
- sh utils/ci/install.sh
180-
- source ~/.cargo/env || true
181191
script:
182-
- bash utils/ci/script.sh
192+
- cargo test --lib --no-default-features
193+
# TODO: add simd_support feature:
194+
- cargo test --features=serde1,log
195+
- cargo test --examples
196+
- cargo test --manifest-path rand_core/Cargo.toml
197+
- cargo test --manifest-path rand_core/Cargo.toml --no-default-features
198+
- cargo test --manifest-path rand_isaac/Cargo.toml --features=serde1
199+
- cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1
200+
- cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1
201+
- cargo test --manifest-path rand_chacha/Cargo.toml
202+
- cargo test --manifest-path rand_hc/Cargo.toml
183203

184204
after_script: set +e
185205

CHANGELOG.md

Lines changed: 61 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,74 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
A [separate changelog is kept for rand_core](rand_core/CHANGELOG.md).
88

9-
You may also find the [Update Guide](UPDATING.md) useful.
10-
11-
12-
## [0.6.0] - Unreleased
13-
14-
### Crate features and organisation
15-
- The ISAAC and Xorshift RNGs have been moved to their own crates: `rand_isaac`
16-
and `rand_xorshift`. (#551, #557)
9+
You may also find the [Upgrade Guide](https://rust-random.github.io/book/update.html) useful.
10+
11+
12+
## [0.6.1] - 2018-11-22
13+
- Support sampling `Duration` also for `no_std` (only since Rust 1.25) (#649)
14+
- Disable default features of `libc` (#647)
15+
16+
## [0.6.0] - 2018-11-14
17+
18+
### Project organisation
19+
- Rand has moved from [rust-lang-nursery](https://github.com/rust-lang-nursery/rand)
20+
to [rust-random](https://github.com/rust-random/rand)! (#578)
21+
- Created [The Rust Random Book](https://rust-random.github.io/book/)
22+
([source](https://github.com/rust-random/book))
23+
- Update copyright and licence notices (#591, #611)
24+
- Migrate policy documentation from the wiki (#544)
25+
26+
### Platforms
27+
- Add fork protection on Unix (#466)
28+
- Added support for wasm-bindgen. (#541, #559, #562, #600)
29+
- Enable `OsRng` for powerpc64, sparc and sparc64 (#609)
30+
- Use `syscall` from `libc` on Linux instead of redefining it (#629)
31+
32+
### RNGs
33+
- Switch `SmallRng` to use PCG (#623)
34+
- Implement `Pcg32` and `Pcg64Mcg` generators (#632)
35+
- Move ISAAC RNGs to a dedicated crate (#551)
36+
- Move Xorshift RNG to its own crate (#557)
37+
- Move ChaCha and HC128 RNGs to dedicated crates (#607, #636)
38+
- Remove usage of `Rc` from `ThreadRng` (#615)
39+
40+
### Sampling and distributions
41+
- Implement `Rng.gen_ratio()` and `Bernoulli::new_ratio()` (#491)
42+
- Make `Uniform` strictly respect `f32` / `f64` high/low bounds (#477)
43+
- Allow `gen_range` and `Uniform` to work on non-`Copy` types (#506)
1744
- `Uniform` supports inclusive ranges: `Uniform::from(a..=b)`. This is
1845
automatically enabled for Rust >= 1.27. (#566)
19-
- Support for `i128` and `u128` is automatically enabled for Rust >= 1.26. This
20-
renders the `i128_support` feature obsolete. It still exists for backwards
21-
compatibility but does not have any effect. This breaks programs using Rand
22-
with `i128_support` on nightlies older than Rust 1.26. (#571)
46+
- Implement `TrustedLen` and `FusedIterator` for `DistIter` (#620)
2347

24-
### New distributions
48+
#### New distributions
49+
- Add the `Dirichlet` distribution (#485)
2550
- Added sampling from the unit sphere and circle. (#567)
51+
- Implement the triangular distribution (#575)
52+
- Implement the Weibull distribution (#576)
53+
- Implement the Beta distribution (#574)
2654

27-
### Sequences module
55+
#### Optimisations
56+
57+
- Optimise `Bernoulli::new` (#500)
58+
- Optimise `char` sampling (#519)
59+
- Optimise sampling of `std::time::Duration` (#583)
60+
61+
### Sequences
62+
- Redesign the `seq` module (#483, #515)
63+
- Add `WeightedIndex` and `choose_weighted` (#518, #547)
2864
- Optimised and changed return type of the `sample_indices` function. (#479)
29-
- Added weighted sampling. (#518)
65+
- Use `Iterator::size_hint()` to speed up `IteratorRandom::choose` (#593)
3066

31-
### Platform support
32-
- Added support for wasm-bindgen. (#541)
33-
- Added basic SIMD support. (#523)
67+
### SIMD
68+
- Support for generating SIMD types (#523, #542, #561, #630)
69+
70+
### Other
71+
- Revise CI scripts (#632, #635)
72+
- Remove functionality already deprecated in 0.5 (#499)
73+
- Support for `i128` and `u128` is automatically enabled for Rust >= 1.26. This
74+
renders the `i128_support` feature obsolete. It still exists for backwards
75+
compatibility but does not have any effect. This breaks programs using Rand
76+
with `i128_support` on nightlies older than Rust 1.26. (#571)
3477

3578

3679
## [0.5.5] - 2018-08-07

CONTRIBUTING.md

Lines changed: 0 additions & 93 deletions
This file was deleted.

COPYRIGHT

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Copyrights in the Rand project are retained by their contributors. No
2+
copyright assignment is required to contribute to the Rand project.
3+
4+
For full authorship information, see the version control history.
5+
6+
Except as otherwise noted (below and/or in individual files), Rand is
7+
licensed under the Apache License, Version 2.0 <LICENSE-APACHE> or
8+
<http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
9+
<LICENSE-MIT> or <http://opensource.org/licenses/MIT>, at your option.
10+
11+
The Rand project includes code from the Rust project
12+
published under these same licenses.

0 commit comments

Comments
 (0)