about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAidan Hobson Sayers <aidanhs@cantab.net>2017-01-15 22:33:58 +0000
committerAidan Hobson Sayers <aidanhs@cantab.net>2017-01-16 03:06:45 +0000
commit70d2372adaf48bb24f8b829417229149bd103e4a (patch)
tree771726183f4b644dda75df603c7f2c5c710144b7 /src/libstd
parentb0c52c587fe9ba287053359fff5ed886b7edb27c (diff)
downloadrust-70d2372adaf48bb24f8b829417229149bd103e4a.tar.gz
rust-70d2372adaf48bb24f8b829417229149bd103e4a.zip
Expose a feature to force use of alloc_system, teach rustbuild
This fixes jemalloc-less local rebuilds, where we tell cargo that
we're actually stage1
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/Cargo.toml1
-rw-r--r--src/libstd/lib.rs9
2 files changed, 6 insertions, 4 deletions
diff --git a/src/libstd/Cargo.toml b/src/libstd/Cargo.toml
index fcf84cb7169..8146e7fb1ed 100644
--- a/src/libstd/Cargo.toml
+++ b/src/libstd/Cargo.toml
@@ -31,4 +31,5 @@ gcc = "0.3.27"
 backtrace = []
 debug-jemalloc = ["alloc_jemalloc/debug"]
 jemalloc = ["alloc_jemalloc"]
+force_alloc_system = []
 panic-unwind = ["panic_unwind"]
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 521b938acfb..37632ac76f2 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -219,9 +219,10 @@
 // Tell the compiler to link to either panic_abort or panic_unwind
 #![needs_panic_runtime]
 
-// Always use alloc_system during stage0 since jemalloc might be unavailable or
-// disabled (Issue #30592)
-#![cfg_attr(stage0, feature(alloc_system))]
+// Always use alloc_system during stage0 since we don't know if the alloc_*
+// crate the stage0 compiler will pick by default is available (most
+// obviously, if the user has disabled jemalloc in `./configure`).
+#![cfg_attr(any(stage0, feature = "force_alloc_system"), feature(alloc_system))]
 
 // Turn warnings into errors, but only after stage0, where it can be useful for
 // code to emit warnings during language transitions
@@ -333,7 +334,7 @@ extern crate libc;
 // We always need an unwinder currently for backtraces
 extern crate unwind;
 
-#[cfg(stage0)]
+#[cfg(any(stage0, feature = "force_alloc_system"))]
 extern crate alloc_system;
 
 // compiler-rt intrinsics