Skip to content

Commit 29a9d1d

Browse files
committed
Don't add std feature to rand_isaac and rand_xorshift
1 parent e7b17dd commit 29a9d1d

File tree

6 files changed

+17
-21
lines changed

6 files changed

+17
-21
lines changed

.travis.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,25 @@ matrix:
1414
# TODO: use --tests instead of --lib on more recent compiler
1515
- cargo test --lib --no-default-features
1616
- cargo test --package rand_core --no-default-features
17-
- cargo test --package rand_isaac --no-default-features
18-
- cargo test --package rand_isaac --features serde1,std
19-
- cargo test --package rand_xorshift --no-default-features
20-
- cargo test --package rand_xorshift --features serde1,std
17+
- cargo test --package rand_isaac --features serde1
18+
- cargo test --package rand_xorshift --features serde1
2119
- cargo test --features serde1,log
2220
- rust: stable
2321
os: osx
2422
install:
2523
script:
2624
- cargo test --tests --no-default-features
2725
- cargo test --package rand_core --no-default-features
28-
- cargo test --package rand_isaac --no-default-features
29-
- cargo test --package rand_isaac --features serde1,std
30-
- cargo test --package rand_xorshift --no-default-features
31-
- cargo test --package rand_xorshift --features serde1,std
26+
- cargo test --package rand_isaac --features serde1
27+
- cargo test --package rand_xorshift --features serde1
3228
- cargo test --features serde1,log
3329
- rust: beta
3430
install:
3531
script:
3632
- cargo test --tests --no-default-features
3733
- cargo test --package rand_core --no-default-features
38-
- cargo test --package rand_isaac --no-default-features
39-
- cargo test --package rand_isaac --features serde1,std
40-
- cargo test --package rand_xorshift --no-default-features
41-
- cargo test --package rand_xorshift --features serde1,std
34+
- cargo test --package rand_isaac --features serde1
35+
- cargo test --package rand_xorshift --features serde1
4236
- cargo test --features serde1,log
4337
- rust: nightly
4438
install:
@@ -49,7 +43,7 @@ matrix:
4943
- cargo test --tests --no-default-features --features=alloc
5044
- cargo test --package rand_core --no-default-features --features=alloc,serde1
5145
- cargo test --features serde1,log,nightly,alloc
52-
- cargo test --all --all-features --benches
46+
- cargo test --all --benches
5347
# remove cached documentation, otherwise files from previous PRs can get included
5448
- rm -rf target/doc
5549
- cargo doc --no-deps --all --all-features

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ appveyor = { repository = "alexcrichton/rand" }
2020
[features]
2121
default = ["std" ] # without "std" rand uses libcore
2222
nightly = ["i128_support", "simd_support"] # enables all features requiring nightly rust
23-
std = ["rand_core/std", "rand_isaac/std", "rand_xorshift/std", "alloc", "libc", "winapi", "cloudabi", "fuchsia-zircon"]
23+
std = ["rand_core/std", "alloc", "libc", "winapi", "cloudabi", "fuchsia-zircon"]
2424
alloc = ["rand_core/alloc"] # enables Vec and Box support (without std)
2525
i128_support = [] # enables i128 and u128 support
2626
simd_support = [] # enables SIMD support

rand_isaac/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ appveyor = { repository = "alexcrichton/rand" }
1919

2020
[features]
2121
serde1 = ["serde", "serde_derive", "rand_core/serde1"]
22-
std = []
2322

2423
[dependencies]
2524
rand_core = { path = "../rand_core", version = "0.2", default-features=false }

rand_isaac/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@
1818
#![deny(missing_debug_implementations)]
1919
#![doc(test(attr(allow(unused_variables), deny(warnings))))]
2020

21-
#![cfg_attr(not(feature="std"), no_std)]
21+
#![cfg_attr(not(all(feature="serde1", test)), no_std)]
2222

23-
#[cfg(feature="std")] extern crate std as core;
2423
extern crate rand_core;
2524

26-
#[cfg(all(feature="serde1", test))] extern crate bincode;
2725
#[cfg(feature="serde1")] extern crate serde;
2826
#[cfg(feature="serde1")] #[macro_use] extern crate serde_derive;
2927

28+
// To test serialization we need bincode and the standard library
29+
#[cfg(all(feature="serde1", test))] extern crate bincode;
30+
#[cfg(all(feature="serde1", test))] extern crate std as core;
31+
3032
pub mod isaac;
3133
pub mod isaac64;
3234

rand_xorshift/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ appveyor = { repository = "alexcrichton/rand" }
1919

2020
[features]
2121
serde1 = ["serde", "serde_derive"]
22-
std = []
2322

2423
[dependencies]
2524
rand_core = { path = "../rand_core", version = "0.2", default-features=false }

rand_xorshift/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818
#![deny(missing_debug_implementations)]
1919
#![doc(test(attr(allow(unused_variables), deny(warnings))))]
2020

21-
#![cfg_attr(not(feature="std"), no_std)]
21+
#![cfg_attr(not(all(feature="serde1", test)), no_std)]
2222

23-
#[cfg(feature="std")] extern crate std as core;
2423
extern crate rand_core;
2524

2625
#[cfg(feature="serde1")] extern crate serde;
2726
#[cfg(feature="serde1")] #[macro_use] extern crate serde_derive;
27+
28+
// To test serialization we need bincode and the standard library
2829
#[cfg(all(feature="serde1", test))] extern crate bincode;
30+
#[cfg(all(feature="serde1", test))] extern crate std as core;
2931

3032
mod xorshift;
3133

0 commit comments

Comments
 (0)