Skip to content

Commit

Permalink
Fix dummy allocator code example (#728)
Browse files Browse the repository at this point in the history
We forgot to remove the `allocator::` prefix when moving the ALLOCATOR declaration into the `allocator` module.
  • Loading branch information
phil-opp authored Jan 28, 2020
1 parent 0c67111 commit 6a56ea2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ The `#[global_allocator]` attribute tells the Rust compiler which allocator inst
// in src/allocator.rs

#[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.
Expand Down

0 comments on commit 6a56ea2

Please sign in to comment.