Skip to content

Commit b3285c7

Browse files
committed
std: Remove unneeded gates from std_detect
We have a handful of `#[unstable]` gates that aren't even being used, because all that matters is the re-export in `std`. For example, the RISC-V macro appears unstable, but has actually been stable since 1.78 <https://doc.rust-lang.org/1.78.0/std/arch/macro.is_riscv_feature_detected.html>.
1 parent 2eb235a commit b3285c7

3 files changed

Lines changed: 18 additions & 21 deletions

File tree

‎library/std_detect/src/detect/arch/mod.rs‎

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,40 @@ mod s390x;
2222

2323
cfg_select! {
2424
any(target_arch = "x86", target_arch = "x86_64") => {
25-
#[stable(feature = "simd_x86", since = "1.27.0")]
26-
pub use x86::*;
25+
pub use x86::__is_feature_detected;
26+
pub(crate) use x86::Feature;
2727
}
2828
target_arch = "arm" => {
29-
#[unstable(feature = "stdarch_arm_feature_detection", issue = "111190")]
30-
pub use arm::*;
29+
pub use arm::__is_feature_detected;
30+
pub(crate) use arm::Feature;
3131
}
3232
any(target_arch = "aarch64", target_arch = "arm64ec") => {
33-
#[stable(feature = "simd_aarch64", since = "1.60.0")]
34-
pub use aarch64::*;
33+
pub use aarch64::__is_feature_detected;
34+
pub(crate) use aarch64::Feature;
3535
}
3636
any(target_arch = "riscv32", target_arch = "riscv64") => {
37-
#[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")]
38-
pub use riscv::*;
37+
pub use riscv::__is_feature_detected;
38+
pub(crate) use riscv::Feature;
3939
}
4040
any(target_arch = "powerpc", target_arch = "powerpc64") => {
41-
#[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")]
42-
pub use powerpc::*;
41+
pub use powerpc::__is_feature_detected;
42+
pub(crate) use powerpc::Feature;
4343
}
4444
target_arch = "mips" => {
45-
#[unstable(feature = "stdarch_mips_feature_detection", issue = "111188")]
46-
pub use mips::*;
45+
pub use mips::__is_feature_detected;
46+
pub(crate) use mips::Feature;
4747
}
4848
target_arch = "mips64" => {
49-
#[unstable(feature = "stdarch_mips_feature_detection", issue = "111188")]
50-
pub use mips64::*;
49+
pub use mips64::__is_feature_detected;
50+
pub(crate) use mips64::Feature;
5151
}
5252
any(target_arch = "loongarch32", target_arch = "loongarch64") => {
53-
#[stable(feature = "stdarch_loongarch_feature", since = "1.89.0")]
54-
pub use loongarch::*;
53+
pub use loongarch::__is_feature_detected;
54+
pub(crate) use loongarch::Feature;
5555
}
5656
target_arch = "s390x" => {
57-
#[stable(feature = "stdarch_s390x_feature_detection", since = "1.93.0")]
58-
pub use s390x::*;
57+
pub use s390x::__is_feature_detected;
58+
pub(crate) use s390x::Feature;
5959
}
6060
_ => {
6161
// Unimplemented architecture:
@@ -64,7 +64,6 @@ cfg_select! {
6464
Null,
6565
}
6666
#[doc(hidden)]
67-
#[unstable(feature = "stdarch_internal", issue = "none")]
6867
pub mod __is_feature_detected {}
6968

7069
impl Feature {

‎library/std_detect/src/detect/macros.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ macro_rules! features {
181181
/// to change.
182182
#[doc(hidden)]
183183
#[cfg($cfg)]
184-
#[unstable(feature = "stdarch_internal", issue = "none")]
185184
pub mod __is_feature_detected {
186185
$(
187186

‎library/std_detect/src/detect/mod.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ mod arch;
2424

2525
// This module needs to be public because the `is_{arch}_feature_detected!`
2626
// macros expand calls to items within it in user crates.
27-
#[doc(hidden)]
2827
#[unstable(feature = "stdarch_internal", issue = "none")]
2928
pub use self::arch::__is_feature_detected;
3029
pub(crate) use self::arch::Feature;

0 commit comments

Comments
 (0)