diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2017-06-03 14:54:08 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2017-07-05 14:37:01 -0700 |
| commit | 695dee063bcd40f154bb27b7beafcb3d4dd775ac (patch) | |
| tree | 8ac64f40091434e679b4221343dce7447c4f1236 /src/liballoc/lib.rs | |
| parent | 4c225c4d1732537aff63dd97c2b7ac681fd3d188 (diff) | |
| download | rust-695dee063bcd40f154bb27b7beafcb3d4dd775ac.tar.gz rust-695dee063bcd40f154bb27b7beafcb3d4dd775ac.zip | |
rustc: Implement the #[global_allocator] attribute
This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/197 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
Diffstat (limited to 'src/liballoc/lib.rs')
| -rw-r--r-- | src/liballoc/lib.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 23da2913136..b419aeb5ab5 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -85,7 +85,7 @@ #![cfg_attr(not(test), feature(slice_rotate))] #![cfg_attr(not(test), feature(str_checked_slicing))] #![cfg_attr(test, feature(rand, test))] -#![feature(allocator)] +#![cfg_attr(stage0, feature(allocator))] #![feature(allow_internal_unstable)] #![feature(box_patterns)] #![feature(box_syntax)] @@ -124,6 +124,7 @@ #![feature(unicode)] #![feature(unique)] #![feature(unsize)] +#![cfg_attr(not(stage0), feature(allocator_internals))] #![cfg_attr(not(test), feature(fused, fn_traits, placement_new_protocol))] #![cfg_attr(test, feature(test, box_heap))] @@ -168,7 +169,6 @@ mod boxed_test; pub mod arc; pub mod rc; pub mod raw_vec; -pub mod oom; // collections modules pub mod binary_heap; @@ -260,8 +260,6 @@ trait SpecExtend<I: IntoIterator> { fn spec_extend(&mut self, iter: I); } -pub use oom::oom; - #[doc(no_inline)] pub use binary_heap::BinaryHeap; #[doc(no_inline)] |
