rust-lang / rust-lang/rust

Tracking Issue for `new_zeroed_alloc`

Open
#129,396 2 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-tracking-issue T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Feature gate: #![feature(new_zeroed_alloc)]

Split-out from https://github.com/rust-lang/rust/issues/63291 as a result of stabilizing most of its API! It's zeroed instead of uninit constructors, nothing too complicated!

Public API

It's new_zeroed and new_zeroed_slice on every major allocation type like Box, Rc, Arc.

impl<T> Box<T> { pub fn new_zeroed() -> Box<MaybeUninit<T>> {…} }
impl<T> Arc<T> { pub fn new_zeroed() -> Arc<MaybeUninit<T>> {…} }
impl<T> Rc<T> { pub fn new_zeroed() -> Rc<MaybeUninit<T>> {…} }

impl<[T]> Box<T> { pub fn new_zeroed_slice() -> Box<MaybeUninit<[T]>> {…} }
impl<[T]> Arc<T> { pub fn new_zeroed_slice() -> Arc<MaybeUninit<[T]>> {…} }
impl<[T]> Rc<T> { pub fn new_zeroed_slice() -> Rc<MaybeUninit<[T]>> {…} }
Steps / History
Unresolved Questions
  • idk lol

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with implementation PR #66128 and the feature lifecycle stabilization guide linked in the issue. Review the listed new_zeroed and new_zeroed_slice APIs on Box, Arc, and Rc, then determine the remaining stabilization steps. Done means completing the final comment period and a stabilization PR.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.