New `Box::new_zeroed`, `Rc::new_zeroed`, `Arc::new_zeroed` APIs and specialized `Iterator::eq` for `TrustedLen` improve allocation patterns and comparison performance; `iter::Repeat::last` now panics instead of looping infinitely.
Summary
Zeroed allocations are now first-class without unsafe boilerplate; iterator specializations reduce unnecessary work for known-length iterators; fixing infinite loop in `Repeat::last` prevents silent hangs in production code.
Why it matters
Zeroed allocations are now first-class without unsafe boilerplate; iterator specializations reduce unnecessary work for known-length iterators; fixing infinite loop in `Repeat::last` prevents silent hangs in production code.
Implementation verdict
Drop in replacement for manual zeroing via `vec![0; n]` or unsafe patterns. Requires Rust update to latest stable. Worth adopting immediately—these are additive stabilizations with no migration cost. The `Repeat::last` panic is breaking but fixes a correctness trap.
Sources
Dev Signal
Get briefs like this in your inbox — free, 3x a week.
100+ sources compressed into one 4-minute read. Ranked, cited, implementation-ready.