Skip to content

Commit

Permalink
Move libstd's default feature to libtest
Browse files Browse the repository at this point in the history
This commit makes it so `std` no longer has a `default` feature, but
instead the `test` crate has a `default` feature doing the same thing.
The purpose of this commit is to allow Cargo's `-Zbuild-std` command,
which could customize the features of the standard library, to handle
the `default` feature for libstd. Currently Cargo's `-Zbuild-std`
support starts at libtests's manifest as the entry point to the std set
of crates.
  • Loading branch information
alexcrichton committed Jul 15, 2020
1 parent 2002eba commit e158913
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/libstd/Cargo.toml
Expand Up @@ -47,8 +47,6 @@ hermit-abi = { version = "0.1.14", features = ['rustc-dep-of-std'] }
wasi = { version = "0.9.0", features = ['rustc-dep-of-std'], default-features = false }

[features]
default = ["std_detect_file_io", "std_detect_dlsym_getauxval", "panic-unwind"]

backtrace = [
"backtrace_rs/dbghelp", # backtrace/symbolize on MSVC
"backtrace_rs/libbacktrace", # symbolize on most platforms
Expand Down
3 changes: 3 additions & 0 deletions src/libtest/Cargo.toml
Expand Up @@ -23,9 +23,12 @@ proc_macro = { path = "../libproc_macro" }

# Forward features to the `std` crate as necessary
[features]
default = ["std_detect_file_io", "std_detect_dlsym_getauxval", "panic-unwind"]
backtrace = ["std/backtrace"]
compiler-builtins-c = ["std/compiler-builtins-c"]
llvm-libunwind = ["std/llvm-libunwind"]
panic-unwind = ["std/panic_unwind"]
panic_immediate_abort = ["std/panic_immediate_abort"]
profiler = ["std/profiler"]
std_detect_file_io = ["std/std_detect_file_io"]
std_detect_dlsym_getauxval = ["std/std_detect_dlsym_getauxval"]

0 comments on commit e158913

Please sign in to comment.