diff options
| author | sayantn <sayantn05@gmail.com> | 2025-05-22 12:36:55 +0530 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2025-05-30 18:04:16 +0000 |
| commit | 5984f7c61d038ee8df5368e22b1c9d9ef854f49b (patch) | |
| tree | 3f46a809f0f4bea3c04150a024afbbbb048a2203 /library/stdarch/crates/std_detect/src/detect/macros.rs | |
| parent | cd63f26d86bb4147a9707bd36bb3cc1cb2cee5ee (diff) | |
| download | rust-5984f7c61d038ee8df5368e22b1c9d9ef854f49b.tar.gz rust-5984f7c61d038ee8df5368e22b1c9d9ef854f49b.zip | |
Add back `std_detect_env_override`
Diffstat (limited to 'library/stdarch/crates/std_detect/src/detect/macros.rs')
| -rw-r--r-- | library/stdarch/crates/std_detect/src/detect/macros.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/library/stdarch/crates/std_detect/src/detect/macros.rs b/library/stdarch/crates/std_detect/src/detect/macros.rs index 64711c189a5..a2994fb7daa 100644 --- a/library/stdarch/crates/std_detect/src/detect/macros.rs +++ b/library/stdarch/crates/std_detect/src/detect/macros.rs @@ -168,6 +168,14 @@ macro_rules! features { Feature::_last => unreachable!(), } } + + #[cfg(feature = "std_detect_env_override")] + pub(crate) fn from_str(s: &str) -> Result<Feature, ()> { + match s { + $($feature_lit => Ok(Feature::$feature),)* + _ => Err(()) + } + } } /// Each function performs run-time feature detection for a single |
