The Wire · Showcase
Custom allocators land on Box, Rc, Arc
By RepoJournal · Filed · About Rust
Rust's core smart pointers just got a long-awaited upgrade, and the compiler is shedding legacy machinery to make room.
A rollup merging 13 PRs [1] brings custom allocators to `(try_)map` on `Box`, `Rc`, and `Arc`, a change that lets you keep your allocator strategy through transformations without resorting to unsound workarounds, though `UniqueArc` and `UniqueRc` are deliberately left out because "too much allocator-related API is missing atm" [2]. The same merge also fixes anon const type recovery in HIR lowering [1], adds an internal DSL for testing binders [1], and corrects debugger visualizer tuple child ordering with PDB debug info [1]. Meanwhile, the deprecated `#[rustc_reservation_impl]` attribute is being removed entirely, closing the door on machinery that only ever had one use case [3]. Over on compiler-builtins, complex number multiplication and division libcalls are now implemented [4], and the CI pipeline is expanding to test on a Canonical-provided `s390x` runner [5]. The team repo formalized a new `wg-build-script` working group [6], signaling deeper investment in build script ergonomics. With 139 commits across 5 repos, the focus is on correctness and infrastructure, not headline features, but allocator support is the one you'll feel in production.
One email a day. Unsubscribe in one click.
Keep up with Rust in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Review your use of Box::map with custom allocators once the next Rust nightly lands rust-lang/rust [plan]
- → Watch for the s390x CI results in compiler-builtins if you target that architecture rust-lang/compiler-builtins [monitor]
- → Track the wg-build-script working group for upcoming build script improvements rust-lang/team [monitor]
References
- [1] Auto merge of #161772 - JonathanBrouwer:rollup-USO96L6, r=JonathanBrouwer rust-lang/rust
- [2] Rollup merge of #161617 - maxdexh:can-i-has-map-allocator, r=nia-e rust-lang/miri
- [3] Rollup merge of #160871 - WaffleLapkin:remove_rustc_reservation_impl, r=oli-obk,JonathanBrouwer rust-lang/rust
- [4] implement `Complex` mul and div libcalls ↗ rust-lang/compiler-builtins
- [5] ci: build and test with s390x-resolute runner rust-lang/compiler-builtins
- [6] Merge pull request #2709 from weihanglo/wg-build-script rust-lang/team