Skip to content

Commit

Permalink
Rename "cpu" feature to "rdrand"
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Richey <joerichey@google.com>
  • Loading branch information
josephlr committed May 29, 2020
1 parent 618593c commit 6aba12c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ jobs:
script:
# We test that getrandom builds for all targets
- echo $STD_TARGETS | xargs -t -n1 cargo build --target
- echo $NO_STD_TARGETS | xargs -t -n1 cargo xbuild --features=cpu --target
- echo $NO_STD_TARGETS | xargs -t -n1 cargo xbuild --features=rdrand --target
# also test minimum dependency versions are usable
- cargo generate-lockfile -Z minimal-versions
- echo $STD_TARGETS | xargs -t -n1 cargo build --target
- echo $NO_STD_TARGETS | xargs -t -n1 cargo xbuild --features=cpu --target
- echo $NO_STD_TARGETS | xargs -t -n1 cargo xbuild --features=rdrand --target

# Trust cross-built/emulated targets. We must repeat all non-default values.
- name: "Linux (MIPS, big-endian)"
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ wasi = "0.9"

[features]
std = []
# Feature to enable fallback CPU-based implementation
cpu = []
# Feature to enable fallback RDRAND-based implementation
rdrand = []
# Feature to enable custom RNG implementations
custom = []
# Unstable feature to support being a libstd dependency
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ cfg_if! {
#[path = "windows.rs"] mod imp;
} else if #[cfg(all(target_arch = "x86_64", target_env = "sgx"))] {
#[path = "rdrand.rs"] mod imp;
} else if #[cfg(all(feature = "cpu",
} else if #[cfg(all(feature = "rdrand",
any(target_arch = "x86_64", target_arch = "x86")))] {
#[path = "rdrand.rs"] mod imp;
} else if #[cfg(feature = "custom")] {
Expand Down Expand Up @@ -219,4 +219,4 @@ pub fn getrandom(dest: &mut [u8]) -> Result<(), Error> {
#[cfg(test)]
mod test_common;
#[cfg(test)]
mod test_cpu;
mod test_rdrand;
2 changes: 1 addition & 1 deletion src/test_cpu.rs → src/test_rdrand.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// We only test the CPU-based RNG source on supported architectures.
// We only test the RDRAND-based RNG source on supported architectures.
#![cfg(any(target_arch = "x86_64", target_arch = "x86"))]

#[path = "rdrand.rs"]
Expand Down

0 comments on commit 6aba12c

Please sign in to comment.