Skip to content

Commit 3b79aaa

Browse files
authored
Merge branch 'master' into error
2 parents df0c772 + a4cd495 commit 3b79aaa

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

.travis.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ sudo: false
3737
# Tests run on rand:
3838
# - test no_std support, but only the unit tests:
3939
# `cargo test --tests --no-default-features`
40+
# - test no_std support, including the alloc feature:
41+
# cargo test --tests --no-default-features --features=alloc
4042
# - run unit tests and doctests with all features which are available on stable:
4143
# `cargo test --features=serde1,log`
4244
# - test examples:
4345
# `cargo test --examples`
4446
# Additional tests on nightly:
4547
# - run unit tests and doctests with all features which are available on nightly:
4648
# `cargo test --all-features`
47-
# - test no_std support, including the nightly alloc feature:
48-
# cargo test --tests --no-default-features --features=alloc
4949
# - run benchmarks as tests:
5050
# `cargo test --benches --features=nightly`
5151
# Tests on subcrates:
@@ -54,6 +54,8 @@ sudo: false
5454
#
5555
# TODO: SIMD support on stable releases
5656
# NOTE: SIMD support is unreliable on nightly; we track the latest release
57+
# NOTE: Test for alloc feature in no_std is not included here because it depends
58+
# on the alloc crate stabilized in Rust 1.36.
5759
matrix:
5860
include:
5961
- rust: 1.32.0
@@ -137,7 +139,7 @@ matrix:
137139
before_script:
138140
- pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
139141
script:
140-
# Differs from standard script: alloc feature, all features, doc build
142+
# Differs from standard script: all features, doc build
141143
- cargo test --tests --no-default-features --features=alloc
142144
- cargo test --all-features
143145
- cargo test --benches --features=nightly
@@ -167,7 +169,7 @@ matrix:
167169
- cargo --list | egrep "^\s*deadlinks$" -q || cargo install cargo-deadlinks
168170
- cargo deadlinks -V
169171
script:
170-
# Differs from standard script: alloc feature, all features, doc build
172+
# Differs from standard script: all features, doc build
171173
- cargo test --tests --no-default-features --features=alloc
172174
- cargo test --all-features
173175
- cargo test --benches --features=nightly
@@ -276,11 +278,13 @@ before_install:
276278
script:
277279
- cargo test --tests --no-default-features
278280
- cargo test --tests --no-default-features --features getrandom
281+
- cargo test --tests --no-default-features --features=alloc
279282
# TODO: add simd_support feature:
280283
- cargo test --features=serde1,log
281284
- cargo test --examples
282285
- cargo test --manifest-path rand_core/Cargo.toml
283286
- cargo test --manifest-path rand_core/Cargo.toml --no-default-features
287+
- cargo test --manifest-path rand_core/Cargo.toml --no-default-features --features=alloc
284288
- cargo test --manifest-path rand_distr/Cargo.toml
285289
- cargo test --manifest-path rand_isaac/Cargo.toml --features=serde1
286290
- cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ You may also find the [Upgrade Guide](https://rust-random.github.io/book/update.
1111
## [Unreleased]
1212
- Fix `no_std` behaviour, appropriately enable c2-chacha's `std` feature (#844)
1313
- Add a `no_std` target to CI to continously evaluate `no_std` status (#844)
14+
- `alloc` feature in `no_std` is available since Rust 1.36 (#856)
1415

1516
## [0.7.0] - 2019-06-28
1617

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Rand release if required, but the change must be noted in the changelog.
8484
Rand is built with these features enabled by default:
8585

8686
- `std` enables functionality dependent on the `std` lib
87-
- `alloc` (implied by `std`) enables functionality requiring an allocator
87+
- `alloc` (implied by `std`) enables functionality requiring an allocator (when using this feature in `no_std`, Rand requires Rustc version 1.36 or greater)
8888
- `getrandom` (implied by `std`) is an optional dependency providing the code
8989
behind `rngs::OsRng`
9090

rand_core/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ 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

77
## [0.5.1] - 2019-08-28
8-
### Added
98
- `OsRng` added to `rand_core` (#863)
109
- `Error::INTERNAL_START` and `Error::CUSTOM_START` constants (#864)
1110
- `Error::raw_os_error` method (#864)
1211
- `Debug` and `Display` formatting for `getrandom` error codes without `std` (#864)
1312
### Changed
13+
- `alloc` feature in `no_std` is available since Rust 1.36 (#856)
1414
- Added `#[inline]` to `Error` conversion methods (#864)
1515

1616
## [0.5.0] - 2019-06-06

rand_core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#![allow(clippy::unreadable_literal)]
3939

4040
#![cfg_attr(not(feature="std"), no_std)]
41-
#![cfg_attr(all(feature="alloc", not(feature="std")), feature(alloc))]
4241

4342

4443
use core::default::Default;

src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
#![doc(test(attr(allow(unused_variables), deny(warnings))))]
5151

5252
#![cfg_attr(not(feature="std"), no_std)]
53-
#![cfg_attr(all(feature="alloc", not(feature="std")), feature(alloc))]
5453
#![cfg_attr(all(feature="simd_support", feature="nightly"), feature(stdsimd))]
5554

5655
#![allow(clippy::excessive_precision, clippy::unreadable_literal, clippy::float_cmp)]
@@ -438,7 +437,7 @@ macro_rules! impl_as_byte_slice {
438437
}
439438
}
440439
}
441-
440+
442441
impl AsByteSliceMut for [Wrapping<$t>] {
443442
fn as_byte_slice_mut(&mut self) -> &mut [u8] {
444443
if self.len() == 0 {
@@ -602,7 +601,7 @@ mod test {
602601
rng.fill(&mut array[..]);
603602
assert_eq!(array, [x as u32, (x >> 32) as u32]);
604603
assert_eq!(rng.next_u32(), x as u32);
605-
604+
606605
// Check equivalence using wrapped arrays
607606
let mut warray = [Wrapping(0u32); 2];
608607
rng.fill(&mut warray[..]);

0 commit comments

Comments
 (0)