Skip to content

Commit 8053d7e

Browse files
committed
Improve compile_error! message
1 parent 25bd5a5 commit 8053d7e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/rdrand.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ unsafe fn rdrand() -> Result<[u8; WORD_SIZE], Error> {
3131
Err(Error::UNKNOWN)
3232
}
3333

34+
// "rdrand" target feature requires "+rdrnd" flag, see https://github.com/rust-lang/rust/issues/49653.
3435
#[cfg(all(target_env = "sgx", not(target_feature = "rdrand")))]
35-
compile_error!("SGX targets must enable RDRAND to get randomness");
36+
compile_error!(
37+
"SGX targets require 'rdrand' target feature. Enable by using -C target-feature=+rdrnd."
38+
);
3639

3740
// TODO use is_x86_feature_detected!("rdrand") when that works in core. See:
3841
// https://github.com/rust-lang-nursery/stdsimd/issues/464

0 commit comments

Comments
 (0)