Skip to content

Commit

Permalink
std: Always use alloc_system in stage0 so snaps work with --disable-j…
Browse files Browse the repository at this point in the history
…emalloc
  • Loading branch information
brson committed Dec 22, 2015
1 parent 6f706a5 commit b723bad
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@
#![feature(vec_push_all)]
#![feature(wrapping)]
#![feature(zero_one)]
// Snapshots are configured to link jemalloc by default, which makes
// CFG_DISABLE_JEMALLOC break in stage0 because alloc_jemalloc doesn't exist.
// This forces stage0 to always use the system allocator.
#![cfg_attr(stage0, feature(alloc_system))]

// Don't link to std. We are std.
#![no_std]
Expand All @@ -285,6 +289,11 @@
unreachable, unimplemented, write, writeln, try)]
extern crate core as __core;

// Snapshots are configured to link jemalloc by default, which makes
// CFG_DISABLE_JEMALLOC break in stage0 because alloc_jemalloc doesn't exist.
// This forces stage0 to always use the system allocator.
#[cfg(stage0)] extern crate alloc_system;

#[macro_use]
#[macro_reexport(vec, format)]
extern crate collections as core_collections;
Expand Down

0 comments on commit b723bad

Please sign in to comment.