Fix dummy allocator code example (#728)

We forgot to remove the `allocator::` prefix when moving the ALLOCATOR declaration into the `allocator` module.
This commit is contained in:
Philipp Oppermann
2020-01-28 17:10:46 +01:00
committed by GitHub
parent 0c67111e68
commit 6a56ea242f

View File

@@ -309,7 +309,7 @@ The `#[global_allocator]` attribute tells the Rust compiler which allocator inst
// in src/allocator.rs // in src/allocator.rs
#[global_allocator] #[global_allocator]
static ALLOCATOR: allocator::Dummy = allocator::Dummy; static ALLOCATOR: Dummy = Dummy;
``` ```
Since the `Dummy` allocator is a [zero sized type], we don't need to specify any fields in the initialization expression. Since the `Dummy` allocator is a [zero sized type], we don't need to specify any fields in the initialization expression.