From b0f15d32b11e51c25fa708f50444d804c9e3dcdb Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 25 Jul 2018 10:55:22 -0700 Subject: [PATCH] beta: only true stage0 needs feature(global_allocator) We use `#[global_allocator]` for `stage0` builds of libstd, and also with `feature = "force_alloc_system"` that's set for a local rebuild, where the bootstrap compiler is the same version and otherwise uses the `--cfg stage1`. We only need the unstable `feature(global_allocator)` for a true `stage0` being 1.27. For rebuilds with 1.28, that feature is stable and causes a denied warning if it's enabled, so we should avoid it. --- src/libstd/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index a6061e96ae587..98ecd4f833dbf 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -331,9 +331,7 @@ // `force_alloc_system` is *only* intended as a workaround for local rebuilds // with a rustc without jemalloc. // FIXME(#44236) shouldn't need MSVC logic -#![cfg_attr(all(not(target_env = "msvc"), - any(all(stage0, not(test)), feature = "force_alloc_system")), - feature(global_allocator))] +#![cfg_attr(all(not(target_env = "msvc"), stage0, not(test)), feature(global_allocator))] #[cfg(all(not(target_env = "msvc"), any(all(stage0, not(test)), feature = "force_alloc_system")))] #[global_allocator]