Skip to content

Commit b0f15d3

Browse files
committed
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.
1 parent 0aaa819 commit b0f15d3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/libstd/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,7 @@
331331
// `force_alloc_system` is *only* intended as a workaround for local rebuilds
332332
// with a rustc without jemalloc.
333333
// FIXME(#44236) shouldn't need MSVC logic
334-
#![cfg_attr(all(not(target_env = "msvc"),
335-
any(all(stage0, not(test)), feature = "force_alloc_system")),
336-
feature(global_allocator))]
334+
#![cfg_attr(all(not(target_env = "msvc"), stage0, not(test)), feature(global_allocator))]
337335
#[cfg(all(not(target_env = "msvc"),
338336
any(all(stage0, not(test)), feature = "force_alloc_system")))]
339337
#[global_allocator]

0 commit comments

Comments
 (0)