```
And that's it! The `#[global_allocator]` attribute is applied to a `static`
-which implements the `Alloc` trait in the `std::heap` module. Note, though,
+which implements the `Alloc` trait in the `std::alloc` module. Note, though,
that the implementation is defined for `&MyAllocator`, not just `MyAllocator`.
You may wish, however, to also provide `Alloc for MyAllocator` for other use
cases.
#![feature(global_allocator, allocator_api)]
#![crate_type = "rlib"]
-use std::heap::System;
+use std::alloc::System;
#[global_allocator]
static A: System = System;
#![feature(global_allocator, allocator_api)]
#![crate_type = "rlib"]
-use std::heap::System;
+use std::alloc::System;
#[global_allocator]
static A: System = System;
#![feature(global_allocator, allocator_api)]
-use std::heap::System;
+use std::alloc::System;
#[global_allocator]
static A: System = System;
extern crate system_allocator;
-use std::heap::System;
+use std::alloc::System;
#[global_allocator]
static A: System = System;
#![feature(allocator_api, nonnull)]
-use std::heap::{Heap, Alloc};
+use std::alloc::{Heap, Alloc};
fn main() {
unsafe {
#![feature(heap_api, allocator_api)]
#![crate_type = "rlib"]
-use std::heap::{GlobalAlloc, System, Layout, Opaque};
+use std::alloc::{GlobalAlloc, System, Layout, Opaque};
use std::sync::atomic::{AtomicUsize, Ordering};
pub struct A(pub AtomicUsize);
#![feature(allocator_api)]
-use std::heap::{Alloc, Heap, Layout};
+use std::alloc::{Alloc, Heap, Layout};
use std::ptr::NonNull;
struct arena(());
#![feature(allocator_api, global_allocator)]
#[global_allocator]
-static A: std::heap::System = std::heap::System;
+static A: std::alloc::System = std::alloc::System;
fn main() {}