Skip to content
Snippets Groups Projects
Commit 6aba12cc authored by Joe Richey's avatar Joe Richey Committed by Joseph Richey
Browse files

Rename "cpu" feature to "rdrand"


Signed-off-by: default avatarJoe Richey <joerichey@google.com>
parent 618593ca
No related branches found
No related tags found
No related merge requests found
......@@ -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)"
......
......@@ -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
......
......@@ -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")] {
......@@ -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;
// 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"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment