Skip to content

Commit 718d7d4

Browse files
Use explicit features rather than implicit.
In Rust 2024 edition, implicit features from optional dependencies are going away and explicit features are required. This changes all features using optional dependencies to use the "dep:" syntax to avoid creating implicit features. It also adds new explicit features for optional dependencies that didn't previously have an explicit feature to enable them. One user-visible implicit feature has now been removed: `rand` no longer has an implicit feature `rand_chacha` as that is enabled by `std_rng`.
1 parent f7bbcca commit 718d7d4

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ You may also find the [Upgrade Guide](https://rust-random.github.io/book/update.
2020
- Fix portability of `rand::distributions::Slice` (#1469)
2121
- Rename `rand::distributions` to `rand::distr` (#1470)
2222
- The `serde1` feature has been renamed `serde` (#1477)
23+
- Remove implicit feature `rand_chacha`. This is enabled by `std_rng`. (#1473)
2324

2425
## [0.9.0-alpha.1] - 2024-03-18
2526
- Add the `Slice::num_choices` method to the Slice distribution (#1402)

Cargo.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ getrandom = ["rand_core/getrandom"]
4646
simd_support = ["zerocopy/simd-nightly"]
4747

4848
# Option (enabled by default): enable StdRng
49-
std_rng = ["rand_chacha"]
49+
std_rng = ["dep:rand_chacha"]
5050

5151
# Option: enable SmallRng
5252
small_rng = []
@@ -56,6 +56,9 @@ small_rng = []
5656
# Note: enabling this option is expected to affect reproducibility of results.
5757
unbiased = []
5858

59+
# Option: enable logging
60+
log = ["dep:log"]
61+
5962
[workspace]
6063
members = [
6164
"rand_core",

rand_core/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ all-features = true
2727
[features]
2828
std = ["alloc", "getrandom?/std"]
2929
alloc = [] # enables Vec and Box support without std
30+
getrandom = ["dep:getrandom"]
3031
serde = ["dep:serde"] # enables serde for BlockRng wrapper
3132

3233
[dependencies]

rand_distr/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ alloc = ["rand/alloc"]
3030
std_math = ["num-traits/std"]
3131

3232
serde = ["dep:serde", "rand/serde"]
33+
serde_with = ["dep:serde_with"]
3334

3435
[dependencies]
3536
rand = { path = "..", version = "=0.9.0-alpha.1", default-features = false }

0 commit comments

Comments
 (0)