about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-09-21 14:42:33 +1000
committerGitHub <noreply@github.com>2025-09-21 14:42:33 +1000
commit7a5819d1544918f8b11105535df58de731a217f9 (patch)
treefcaa0bd5df118dd4c30a0828db5c07c78439c84a /compiler
parentd2533189ded231436f4db4975da476e7630eaed2 (diff)
parent175afd76180d47b655377768a87a55f8581686f0 (diff)
downloadrust-7a5819d1544918f8b11105535df58de731a217f9.tar.gz
rust-7a5819d1544918f8b11105535df58de731a217f9.zip
Rollup merge of #144091 - thaliaarchi:stabilize-new-zeroed, r=Mark-Simulacrum
Stabilize `new_zeroed_alloc`

The corresponding `new_uninit` and `new_uninit_slice` functions were stabilized in rust-lang/rust#129401, but the zeroed counterparts were left for later out of a [desire](https://github.com/rust-lang/rust/issues/63291#issuecomment-2161039756) to stabilize only the minimal set. These functions are straightforward mirrors of the uninit functions and well-established. Since no blockers or design questions have surfaced in the past year, I think it's time to stabilize them.

Tracking issue: rust-lang/rust#129396
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_index/src/bit_set.rs4
-rw-r--r--compiler/rustc_index/src/lib.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_index/src/bit_set.rs b/compiler/rustc_index/src/bit_set.rs
index 684bd34f909..f7649c5f5c5 100644
--- a/compiler/rustc_index/src/bit_set.rs
+++ b/compiler/rustc_index/src/bit_set.rs
@@ -645,7 +645,7 @@ impl<T: Idx> ChunkedBitSet<T> {
                     };
                     #[cfg(not(feature = "nightly"))]
                     let mut words = {
-                        // FIXME: unconditionally use `Rc::new_zeroed` once it is stable (#63291).
+                        // FIXME: unconditionally use `Rc::new_zeroed` once it is stable (#129396).
                         let words = mem::MaybeUninit::<[Word; CHUNK_WORDS]>::zeroed();
                         // SAFETY: `words` can safely be all zeroes.
                         let words = unsafe { words.assume_init() };
@@ -708,7 +708,7 @@ impl<T: Idx> ChunkedBitSet<T> {
                     };
                     #[cfg(not(feature = "nightly"))]
                     let mut words = {
-                        // FIXME: unconditionally use `Rc::new_zeroed` once it is stable (#63291).
+                        // FIXME: unconditionally use `Rc::new_zeroed` once it is stable (#129396).
                         let words = mem::MaybeUninit::<[Word; CHUNK_WORDS]>::zeroed();
                         // SAFETY: `words` can safely be all zeroes.
                         let words = unsafe { words.assume_init() };
diff --git a/compiler/rustc_index/src/lib.rs b/compiler/rustc_index/src/lib.rs
index cc680838e7e..9d647209c6f 100644
--- a/compiler/rustc_index/src/lib.rs
+++ b/compiler/rustc_index/src/lib.rs
@@ -1,9 +1,9 @@
 // tidy-alphabetical-start
 #![cfg_attr(all(feature = "nightly", test), feature(stmt_expr_attributes))]
+#![cfg_attr(bootstrap, feature(new_zeroed_alloc))]
 #![cfg_attr(feature = "nightly", allow(internal_features))]
 #![cfg_attr(feature = "nightly", feature(extend_one, step_trait, test))]
 #![cfg_attr(feature = "nightly", feature(new_range_api))]
-#![cfg_attr(feature = "nightly", feature(new_zeroed_alloc))]
 // tidy-alphabetical-end
 
 pub mod bit_set;