Skip to content

Commit 0689cb5

Browse files
committed
Rename "cpu" feature to "rdrand"
Signed-off-by: Joe Richey <[email protected]>
1 parent 5130d5d commit 0689cb5

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ jobs:
145145
script:
146146
# We test that getrandom builds for all targets
147147
- echo $STD_TARGETS | xargs -t -n1 cargo build --target
148-
- echo $NO_STD_TARGETS | xargs -t -n1 cargo xbuild --features=cpu --target
148+
- echo $NO_STD_TARGETS | xargs -t -n1 cargo xbuild --features=rdrand --target
149149
# also test minimum dependency versions are usable
150150
- cargo generate-lockfile -Z minimal-versions
151151
- echo $STD_TARGETS | xargs -t -n1 cargo build --target
152-
- echo $NO_STD_TARGETS | xargs -t -n1 cargo xbuild --features=cpu --target
152+
- echo $NO_STD_TARGETS | xargs -t -n1 cargo xbuild --features=rdrand --target
153153

154154
# Trust cross-built/emulated targets. We must repeat all non-default values.
155155
- name: "Linux (MIPS, big-endian)"

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ wasi = "0.9"
3535

3636
[features]
3737
std = []
38-
# Feature to enable fallback CPU-based implementation
39-
cpu = []
38+
# Feature to enable fallback RDRAND-based implementation
39+
rdrand = []
4040
# Feature to enable custom RNG implementations
4141
custom = []
4242
# Unstable feature to support being a libstd dependency

src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ cfg_if! {
183183
#[path = "windows.rs"] mod imp;
184184
} else if #[cfg(all(target_arch = "x86_64", target_env = "sgx"))] {
185185
#[path = "rdrand.rs"] mod imp;
186-
} else if #[cfg(all(feature = "cpu",
186+
} else if #[cfg(all(feature = "rdrand",
187187
any(target_arch = "x86_64", target_arch = "x86")))] {
188188
#[path = "rdrand.rs"] mod imp;
189189
} else if #[cfg(feature = "custom")] {
@@ -219,4 +219,4 @@ pub fn getrandom(dest: &mut [u8]) -> Result<(), Error> {
219219
#[cfg(test)]
220220
mod test_common;
221221
#[cfg(test)]
222-
mod test_cpu;
222+
mod test_rdrand;

src/test_cpu.rs src/test_rdrand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// We only test the CPU-based RNG source on supported architectures.
1+
// We only test the RDRAND-based RNG source on supported architectures.
22
#![cfg(any(target_arch = "x86_64", target_arch = "x86"))]
33

44
#[path = "rdrand.rs"]

0 commit comments

Comments
 (0)