From 17a173ebb5cb87271069abdaa0fb9c01d4c8d9d4 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sun, 11 Apr 2021 18:02:11 -0700 Subject: [PATCH] Clean up build warning --- core/src/validator.rs | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/core/src/validator.rs b/core/src/validator.rs index 6c56825380..1bc8ddf024 100644 --- a/core/src/validator.rs +++ b/core/src/validator.rs @@ -1408,22 +1408,17 @@ fn report_target_features() { not(target_os = "macos") ))] { - unsafe { check_avx() }; - } -} - -// Validator binaries built on a machine with AVX support will generate invalid opcodes -// when run on machines without AVX causing a non-obvious process abort. Instead detect -// the mismatch and error cleanly. -#[target_feature(enable = "avx")] -unsafe fn check_avx() { - if is_x86_feature_detected!("avx") { - info!("AVX detected"); - } else { - error!( - "Your machine does not have AVX support, please rebuild from source on your machine" - ); - abort(); + // Validator binaries built on a machine with AVX support will generate invalid opcodes + // when run on machines without AVX causing a non-obvious process abort. Instead detect + // the mismatch and error cleanly. + if is_x86_feature_detected!("avx") { + info!("AVX detected"); + } else { + error!( + "Your machine does not have AVX support, please rebuild from source on your machine" + ); + abort(); + } } }