Rust 1.100 Stabilises the Allocator Trait for Vec and Box, With More to Come
Software / news
Rust 1.100 Stabilises the Allocator Trait for Vec and Box, With More to Come
The Nov. 12 release lets library authors hand a custom allocator to two collection types. A community walkthrough shows what that looks like in practice.
Rust 1.100.0, released on Nov. 12, stabilised the core of allocator_api, the long-running feature that lets a program choose where a collection gets its memory. The release post says it "brings about the stabilization of the core parts of allocator_api", so library authors can now write a custom allocator and pass it to Vec and Box on the stable compiler.
Until now, a collection in Rust took memory from one global allocator, chosen once for the whole program. The new API moves that choice to the collection.
What is stable in Rust 1.100
The post lists the stable pieces by type. It does not list what is still unstable, beyond calling this the foundation of the Allocators 1.0 project goal and writing "A lot remains to be done still."
| Type | Stable in 1.100.0 |
|---|---|
std::alloc | Allocator trait, Global, System |
Allocator impls | Global, System, &A, &mut A, Box<T, A>, Arc<T, A>, Rc<T, A> |
Box | new_in, from_raw_in, from_non_null_in, allocator and two raw-pointer conversions |
Vec | new_in, with_capacity_in, from_raw_parts_in, from_parts_in, allocator and two conversions |
The post also says "expect to see more being stabilized soon", which implies other collections and pointer types are not covered yet. The release post does not name which ones.
What a custom allocator looks like
A blogger who posts under the handle cetra3 published a walkthrough on Nov. 24, titled "The state of Rust allocators in 2026: stabilised". The page carries no byline beyond the handle, and it links the 1.100 release post but no RFC or tracking issue. It says allocators were in "10 years of limbo".
The examples are small programs, each built on Vec::new_in or Box::new_in:
- A bump allocator that takes memory in 32 MiB blocks. The post says dropping it "takes virtually no time at all", and a loop allocates 1,000,000 linked nodes from it.
- An accounting allocator that adds 1024 bytes and then 4096 more, for 5120 bytes in total, and reports usage back every 64 KiB.
- A threshold allocator that fires a callback at 100 MiB. It adds 10 MiB per loop for 10 loops, and the callback reports 167,772,160 bytes.
- A small-stack allocator with an 8192-byte inline buffer. A
Vec<u32>test keeps 32 items inline and pushes 10,000 in total. - A block-aligned allocator at 4096-byte alignment, aimed at device I/O where block sizes are usually multiples of 512.
Other toolchains changed in November too: Go 1.28 turned one transport method into a no-op, and the Rust-written Nvdriver is a project that manages its own kernel memory.
What to check before relying on it
The walkthrough has no benchmarks. Its performance statements are qualitative, so a reader who wants to know whether a bump allocator beats the system allocator for a given workload has to measure it.
The practical limit is the one the release post names: only Vec and Box have stable _in constructors in the table above. Code that needs a custom allocator on another collection waits for a later release. The post gives no date for that work.
Sources
More in Software
- 01Touch ID for sudo on macOS: Four Steps of Setup and Two Places It Stops WorkingA Nov. 30 post walks through sudo_local on macOS Sonoma and later. Its readers added the tmux fix, and one warns that a passwordless gdb rule is root.
- 02Roc 0.1.0 Ships After Eight Years, Built on a 487-Day Rewrite From Rust to ZigThe release notes say only "Roc version 0.1.0." The numbers are in Richard Feldman's two blog posts, and several of them cut against the rewrite.
- 03A Linux Memory-Pressure Flag Throttled Every nginx Socket at CDN77 for Five HoursThe cause was a cgroup reclaim heuristic, not a lack of free RAM, and the only visible trace is a counter that arrived in Linux 6.19.
- 04Superpowers, at 330,000 Stars, Retunes Brainstorming a Third TimeIssue #2530 says the v7 questions waste tokens, and the fix in draft pull request #2756 was written by Claude Fable 5.2.