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
This commit is contained in:
Alex Crichton 2017-06-03 14:54:08 -07:00
parent 4c225c4d17
commit 695dee063b
115 changed files with 2860 additions and 1201 deletions

View file

@ -11,7 +11,7 @@
// compile-flags: -C no-prepopulate-passes
#![crate_type = "lib"]
#![feature(allocator)]
#![feature(custom_attribute)]
pub struct S {
_field: [i64; 4],