-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move XorShiftRng
to its own crate
#557
Changes from 1 commit
a253a80
a385938
2cf9acb
9b069fe
2847c8a
ecc6e66
a3ac8d3
2a658d9
dac6227
ecd1867
e7b17dd
29a9d1d
cb275bc
d2e7378
b846c30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,15 @@ travis-ci = { repository = "rust-lang-nursery/rand" } | |
appveyor = { repository = "alexcrichton/rand" } | ||
|
||
[features] | ||
serde1 = ["serde", "serde_derive"] # enables serde for BlockRng wrapper | ||
serde1 = ["serde", "serde_derive", "rand_core/serde1"] | ||
std = [] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't follow why you added an extra There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, exactly. The test uses There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think about only enabling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems a bit fragile. What if you want to test Serde without |
||
|
||
[dependencies] | ||
rand_core = { path = "../rand_core", version = "0.2", default-features=false } | ||
serde = { version = "1", optional = true } | ||
serde_derive = { version = "^1.0.38", optional = true } | ||
|
||
[dev-dependencies] | ||
# This is for testing serde, unfortunately we can't specify feature-gated dev | ||
# deps yet, see: https://github.com/rust-lang/cargo/issues/1596 | ||
bincode = "1" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,15 @@ travis-ci = { repository = "rust-lang-nursery/rand" } | |
appveyor = { repository = "alexcrichton/rand" } | ||
|
||
[features] | ||
serde1 = ["serde", "serde_derive"] # enables serde for BlockRng wrapper | ||
serde1 = ["serde", "serde_derive"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as for |
||
std = [] | ||
|
||
[dependencies] | ||
rand_core = { path = "../rand_core", version = "0.2", default-features=false } | ||
serde = { version = "1", optional = true } | ||
serde_derive = { version = "^1.0.38", optional = true } | ||
|
||
[dev-dependencies] | ||
# This is for testing serde, unfortunately we can't specify feature-gated dev | ||
# deps yet, see: https://github.com/rust-lang/cargo/issues/1596 | ||
bincode = "1" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -237,7 +237,7 @@ | |
#[cfg(feature="std")] extern crate std as core; | ||
#[cfg(all(feature = "alloc", not(feature="std")))] extern crate alloc; | ||
|
||
#[cfg(test)] #[cfg(feature="serde1")] extern crate bincode; | ||
#[cfg(all(feature="serde1", test))] extern crate bincode; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment does not really belong to this PR, but does rand still need bincode as dependency, or do all tests now live in external crates? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, after this PR rand does not depend directly on serde or bincode anymore. I removed them. We might want to implement Serde support for |
||
#[cfg(feature="serde1")] extern crate serde; | ||
|
||
#[cfg(all(target_arch="wasm32", not(target_os="emscripten"), feature="stdweb"))] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feature
serde1
implicitly impliesstd
— should probably be documented with a comment here and in the READMEThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? We don't require
std
for theserde1
feature, and Serde works withoutstd
. We only needstd
for the tests.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry. I mis-understood the double-negative conditional
no_std
attribute.