Skip to content

Commit 1b0b7e9

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 b1b0a15 commit 1b0b7e9

File tree

5 files changed

+26
-17
lines changed

5 files changed

+26
-17
lines changed

Cargo.lock

+12
Original file line numberDiff line numberDiff line change
@@ -5032,10 +5032,22 @@ dependencies = [
50325032
"profiler_builtins",
50335033
"rand 0.7.3",
50345034
"rustc-demangle",
5035+
"std_detect",
50355036
"unwind",
50365037
"wasi",
50375038
]
50385039

5040+
[[package]]
5041+
name = "std_detect"
5042+
version = "0.1.5"
5043+
dependencies = [
5044+
"cfg-if 0.1.10",
5045+
"compiler_builtins",
5046+
"libc",
5047+
"rustc-std-workspace-alloc",
5048+
"rustc-std-workspace-core",
5049+
]
5050+
50395051
[[package]]
50405052
name = "string_cache"
50415053
version = "0.8.0"

Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ exclude = [
4545
# not all `Cargo.toml` files are available, so we exclude the `x` binary,
4646
# so it can be invoked before the current checkout is set up.
4747
"src/tools/x",
48+
# stdarch has its own Cargo workspace
49+
"library/stdarch",
4850
]
4951

5052
[profile.release.package.compiler_builtins]

library/std/Cargo.toml

+3-2
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

library/std/src/lib.rs

+8-14
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")]

library/stdarch

Submodule stdarch updated 57 files

0 commit comments

Comments
 (0)