Skip to content

Commit a05d4bd

Browse files
committed
DRAFT: std_detect: Remove support for implied by target_features
This commit tests whether `implied by target_features: [...]` inside the target description macro `features!` can be removed.
1 parent d3adc3b commit a05d4bd

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

library/std_detect/src/detect/macros.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
#[unstable(feature = "stdarch_internal", issue = "none")]
44
macro_rules! detect_feature {
55
($feature:tt, $feature_lit:tt) => {
6-
$crate::detect_feature!($feature, $feature_lit : $feature_lit)
7-
};
8-
($feature:tt, $feature_lit:tt : $($target_feature_lit:tt),*) => {
9-
$(cfg!(target_feature = $target_feature_lit) ||)*
10-
$crate::detect::__is_feature_detected::$feature()
6+
cfg!(target_feature = $feature_lit) || $crate::detect::__is_feature_detected::$feature()
117
};
128
($feature:tt, $feature_lit:tt : cfg($target_feature_cfg:meta)) => {
139
cfg!($target_feature_cfg) || $crate::detect::__is_feature_detected::$feature()
@@ -20,10 +16,7 @@ macro_rules! detect_feature {
2016
#[allow(unused_macros, reason = "it's used in the features! macro below")]
2117
macro_rules! check_cfg_feature {
2218
($feature:tt, $feature_lit:tt) => {
23-
check_cfg_feature!($feature, $feature_lit : $feature_lit)
24-
};
25-
($feature:tt, $feature_lit:tt : $($target_feature_lit:tt),*) => {
26-
$(cfg!(target_feature = $target_feature_lit);)*
19+
cfg!(target_feature = $feature_lit);
2720
};
2821
($feature:tt, $feature_lit:tt : cfg($target_feature_cfg:meta)) => {
2922
cfg!($target_feature_cfg);
@@ -47,7 +40,6 @@ macro_rules! features {
4740
$(@NO_RUNTIME_DETECTION: $nort_feature:tt; )*
4841
$(@FEATURE: #[$stability_attr:meta] $feature:ident: $feature_lit:tt;
4942
$(without cfg check: $feature_cfg_check:tt;)?
50-
$(implied by target_features: [$($target_feature_lit:tt),*];)?
5143
$(implied by cfg($target_feature_cfg:meta);)?
5244
$(#[$feature_comment:meta])*)*
5345
) => {
@@ -63,7 +55,6 @@ macro_rules! features {
6355
$feature,
6456
$feature_lit
6557
$(, without cfg check: $feature_cfg_check)?
66-
$(: $($target_feature_lit),*)?
6758
$(: cfg($target_feature_cfg))?
6859
)
6960
};
@@ -154,7 +145,6 @@ macro_rules! features {
154145
$feature,
155146
$feature_lit
156147
$(, without cfg check: $feature_cfg_check)?
157-
$(: $($target_feature_lit),*)?
158148
$(: cfg($target_feature_cfg))?
159149
);
160150
)*

0 commit comments

Comments
 (0)