From f3140f4b25860a1aa6257c6afc064efe177b0b67 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Mon, 9 Sep 2019 11:45:41 +0200 Subject: Factor out check_for All the os-specific code implements a `check_for` and a `detect_features`. Move the always identical check_for in the mod.rs and use `os::detect_features` there. --- library/stdarch/crates/std_detect/src/detect/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'library/stdarch/crates/std_detect/src/detect/mod.rs') diff --git a/library/stdarch/crates/std_detect/src/detect/mod.rs b/library/stdarch/crates/std_detect/src/detect/mod.rs index 80207daad8f..3e00c205547 100644 --- a/library/stdarch/crates/std_detect/src/detect/mod.rs +++ b/library/stdarch/crates/std_detect/src/detect/mod.rs @@ -90,4 +90,9 @@ cfg_if! { mod os; } } -pub use self::os::check_for; + +/// Performs run-time feature detection. +#[inline] +pub fn check_for(x: Feature) -> bool { + cache::test(x as u32, self::os::detect_features) +} -- cgit 1.4.1-3-g733a5