rust-lang / rust-lang/rust

Tracking Issue for maybe_uninit_fill

Open
#117,428 21 comments 5 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

View all comments

Feature gate: #![feature(maybe_uninit_fill)]

This is a tracking issue for ACP https://github.com/rust-lang/libs-team/issues/156

Public API
// in core

impl<T> [MaybeUninit<T>] {
    pub fn write_filled(&mut self, value: T) -> &mut [T]
    where
        T: Clone;

    pub fn write_with<F>(&mut self, mut f: F) -> &mut [T]
    where
        F: FnMut(usize) -> T;

    pub fn write_iter<I>(&mut self, it: I) -> (&mut [T], &mut [MaybeUninit<T>])
    where
        I: IntoIterator<Item = T>;
}
Steps / History
Unresolved Questions
  • Naming: these were originally named fill, fill_with, and fill_from to be consistent consistent with slice::{fill_with,fill_from}. Since changing to slice-inherent methods, these needed to be renamed to avoid conflict. Should we change to naming that keeps fill? Amanieu suggested fill_init at https://github.com/rust-lang/rust/pull/129259#issuecomment-2501783702.

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 the public API and the linked implementation PRs for the maybe_uninit_fill feature gate. Review the unresolved naming question and the stabilization lifecycle guidance; done means resolving the open design work, completing the final comment period, and preparing the stabilization PR.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.