about summary refs log tree commit diff
path: root/src/liballoc_system/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-09-12 18:12:21 +0000
committerbors <bors@rust-lang.org>2017-09-12 18:12:21 +0000
commitdd08c30703d052205a68ae34331eea464178cd99 (patch)
tree19df045809158d1b422468393327e0c79e3fd145 /src/liballoc_system/lib.rs
parenta7b7dce02da1b10f6da79b2f2e93a73314faf497 (diff)
parent94297c67465c3bd124063de717f7574491f5cc7d (diff)
Auto merge of #44133 - vorner:allocator-kind-autodetect, r=alexcrichton
Autodetect the type of allocator crate used

Annotate the allocator crates (allocator_system, allocator_jemalloc) by the type of allocator they are. If one is requested as an exe allocator, detect its type by the flags.

This has the effect that using this (de jure wrong) configuration in the target spec works instead of producing a really unhelpful and arcane linker error:

"exe-allocation-crate": "alloc_system"

Fixes #43524.

There are two yet unsolved FIXME's, I'll be glad for some advice on what to do with them.
Diffstat (limited to 'src/liballoc_system/lib.rs')
-rw-r--r--src/liballoc_system/lib.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/liballoc_system/lib.rs b/src/liballoc_system/lib.rs
index 599d79104c3..2eb659699eb 100644
--- a/src/liballoc_system/lib.rs
+++ b/src/liballoc_system/lib.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 #![no_std]
+#![allow(unused_attributes)]
 #![deny(warnings)]
 #![unstable(feature = "alloc_system",
             reason = "this library is unlikely to be stabilized in its current \
@@ -19,7 +20,9 @@
 #![feature(alloc)]
 #![feature(core_intrinsics)]
 #![feature(staged_api)]
+#![feature(rustc_attrs)]
 #![cfg_attr(any(unix, target_os = "redox"), feature(libc))]
+#![rustc_alloc_kind = "lib"]
 
 // The minimum alignment guaranteed by the architecture. This value is used to
 // add fast paths for low alignment values. In practice, the alignment is a