about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAidan Hobson Sayers <aidanhs@cantab.net>2017-08-10 14:40:42 +0100
committerAidan Hobson Sayers <aidanhs@cantab.net>2017-08-10 16:22:09 +0100
commit56a07539c0efd865b33dd07cd14b97d8ba23c584 (patch)
tree1e1b60a6463232895e818d8f16a931f5efbc3049 /src/libstd
parent458ba7aeb5c1ad3e18dd5c0fe261e1004dbb7a42 (diff)
downloadrust-56a07539c0efd865b33dd07cd14b97d8ba23c584.tar.gz
rust-56a07539c0efd865b33dd07cd14b97d8ba23c584.zip
Fix cross-crate global allocators on windows
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/lib.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 8850a8a5582..f7748aa3f04 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -319,12 +319,18 @@
 #![default_lib_allocator]
 
 // 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`).
+// crate the stage0 compiler will pick by default is enabled (e.g.
+// if the user has disabled jemalloc in `./configure`).
 // `force_alloc_system` is *only* intended as a workaround for local rebuilds
 // with a rustc without jemalloc.
-#![cfg_attr(any(stage0, feature = "force_alloc_system"), feature(global_allocator))]
-#[cfg(any(stage0, feature = "force_alloc_system"))]
+// The not(stage0+msvc) gates will only last until the next stage0 bump
+#![cfg_attr(all(
+        not(all(stage0, target_env = "msvc")),
+        any(stage0, feature = "force_alloc_system")),
+    feature(global_allocator))]
+#[cfg(all(
+    not(all(stage0, target_env = "msvc")),
+    any(stage0, feature = "force_alloc_system")))]
 #[global_allocator]
 static ALLOC: alloc_system::System = alloc_system::System;