Skip to content

Commit 53f1420

Browse files
committed
Improve compile_error! message
1 parent 25bd5a5 commit 53f1420

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/rdrand.rs

+4-1
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 "+rdrand" 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)