Skip to content

Commit a7b83bd

Browse files
committed
Update stdarch submodule (to before it switched to const generics)
This also includes a cherry-pick of rust-lang/stdarch@ec14619 and rust-lang/stdarch#1108 to fix a build failure. It also adds a re-export of various macros to the crate root of libstd - previously they would show up automatically because std_detect was defined in the same crate.
1 parent dcf5f2a commit a7b83bd

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

std/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ compiler_builtins = { version = "0.1.39" }
2121
profiler_builtins = { path = "../profiler_builtins", optional = true }
2222
unwind = { path = "../unwind" }
2323
hashbrown = { version = "0.11", default-features = false, features = ['rustc-dep-of-std'] }
24+
std_detect = { path = "../stdarch/crates/std_detect", default-features = false, features = ['rustc-dep-of-std'] }
2425

2526
# Dependencies of the `backtrace` crate
2627
addr2line = { version = "0.14.0", optional = true, default-features = false }
@@ -70,8 +71,8 @@ panic_immediate_abort = ["core/panic_immediate_abort"]
7071

7172
# Enable std_detect default features for stdarch/crates/std_detect:
7273
# https://github.com/rust-lang/stdarch/blob/master/crates/std_detect/Cargo.toml
73-
std_detect_file_io = []
74-
std_detect_dlsym_getauxval = []
74+
std_detect_file_io = ["std_detect/std_detect_file_io"]
75+
std_detect_dlsym_getauxval = ["std_detect/std_detect_dlsym_getauxval"]
7576

7677
[package.metadata.fortanix-sgx]
7778
# Maximum possible number of threads when testing

std/src/lib.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -539,22 +539,16 @@ pub mod rt;
539539
#[allow(dead_code, unused_attributes)]
540540
mod backtrace_rs;
541541

542-
// Pull in the `std_detect` crate directly into libstd. The contents of
543-
// `std_detect` are in a different repository: rust-lang/stdarch.
544-
//
545-
// `std_detect` depends on libstd, but the contents of this module are
546-
// set up in such a way that directly pulling it here works such that the
547-
// crate uses the this crate as its libstd.
548-
#[path = "../../stdarch/crates/std_detect/src/mod.rs"]
549-
#[allow(missing_debug_implementations, missing_docs, dead_code)]
550-
#[unstable(feature = "stdsimd", issue = "48556")]
551-
#[cfg(not(test))]
552-
mod std_detect;
553-
542+
#[stable(feature = "simd_x86", since = "1.27.0")]
543+
pub use std_detect::is_x86_feature_detected;
554544
#[doc(hidden)]
555545
#[unstable(feature = "stdsimd", issue = "48556")]
556-
#[cfg(not(test))]
557-
pub use std_detect::detect;
546+
pub use std_detect::*;
547+
#[unstable(feature = "stdsimd", issue = "48556")]
548+
pub use std_detect::{
549+
is_aarch64_feature_detected, is_arm_feature_detected, is_mips64_feature_detected,
550+
is_mips_feature_detected, is_powerpc64_feature_detected, is_powerpc_feature_detected,
551+
};
558552

559553
// Re-export macros defined in libcore.
560554
#[stable(feature = "rust1", since = "1.0.0")]

stdarch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit 9c732a56f67f54d12a0b4fd99993154906c95ea6
1+
Subproject commit 19f5459dd0f89e466b7bcaa0f69ecca90f21a4d1

0 commit comments

Comments
 (0)