-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Since #43320 bumped the bootstrap compiler, stage0 libstd fails to build when jemalloc is disabled:
error[E0463]: can't find crate for `alloc_jemalloc`
error: aborting due to previous error
error: Could not compile `std`.
I believe it needs to restore the logic removed here:
https://github.com/rust-lang/rust/pull/42727/files#diff-242481015141f373dcb178e93cffa850L236
I tried to add this to libstd/lib.rs
:
// 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(global_allocator))]
#![cfg(any(stage0, feature = "force_alloc_system"))]
#[global_allocator]
static ALLOC: alloc_system::System = alloc_system::System;
Then stage0 passed, but stage1 std failed like:
error[E0463]: can't find crate for `std`
error: aborting due to previous error
error: Could not compile `std`.
😕
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.