Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 36a935b

Browse files
Stabilize new_zeroed_alloc
1 parent 9cd918b commit 36a935b

File tree

6 files changed

+9
-22
lines changed

6 files changed

+9
-22
lines changed

‎compiler/rustc_index/src/bit_set.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,14 +629,14 @@ impl<T: Idx> ChunkedBitSet<T> {
629629
match *chunk {
630630
Zeros(chunk_domain_size) => {
631631
if chunk_domain_size > 1 {
632-
#[cfg(feature = "nightly")]
632+
#[cfg(any(feature = "nightly", bootstrap))]
633633
let mut words = {
634634
// We take some effort to avoid copying the words.
635635
let words = Rc::<[Word; CHUNK_WORDS]>::new_zeroed();
636636
// SAFETY: `words` can safely be all zeroes.
637637
unsafe { words.assume_init() }
638638
};
639-
#[cfg(not(feature = "nightly"))]
639+
#[cfg(not(any(feature = "nightly", bootstrap)))]
640640
let mut words = {
641641
// FIXME: unconditionally use `Rc::new_zeroed` once it is stable (#63291).
642642
let words = mem::MaybeUninit::<[Word; CHUNK_WORDS]>::zeroed();

‎compiler/rustc_index/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#![cfg_attr(feature = "nightly", allow(internal_features))]
44
#![cfg_attr(feature = "nightly", feature(extend_one, step_trait, test))]
55
#![cfg_attr(feature = "nightly", feature(new_range_api))]
6-
#![cfg_attr(feature = "nightly", feature(new_zeroed_alloc))]
6+
#![cfg_attr(any(feature = "nightly", not(bootstrap)), feature(new_zeroed_alloc))]
77
// tidy-alphabetical-end
88

99
pub mod bit_set;

‎library/alloc/src/boxed.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,6 @@ impl<T> Box<T> {
290290
/// # Examples
291291
///
292292
/// ```
293-
/// #![feature(new_zeroed_alloc)]
294-
///
295293
/// let zero = Box::<u32>::new_zeroed();
296294
/// let zero = unsafe { zero.assume_init() };
297295
///
@@ -301,7 +299,7 @@ impl<T> Box<T> {
301299
/// [zeroed]: mem::MaybeUninit::zeroed
302300
#[cfg(not(no_global_oom_handling))]
303301
#[inline]
304-
#[unstable(feature = "new_zeroed_alloc", issue = "129396")]
302+
#[stable(feature = "new_zeroed_alloc", since = "CURRENT_RUSTC_VERSION")]
305303
#[must_use]
306304
pub fn new_zeroed() -> Box<mem::MaybeUninit<T>> {
307305
Self::new_zeroed_in(Global)
@@ -660,8 +658,6 @@ impl<T> Box<[T]> {
660658
/// # Examples
661659
///
662660
/// ```
663-
/// #![feature(new_zeroed_alloc)]
664-
///
665661
/// let values = Box::<[u32]>::new_zeroed_slice(3);
666662
/// let values = unsafe { values.assume_init() };
667663
///
@@ -670,7 +666,7 @@ impl<T> Box<[T]> {
670666
///
671667
/// [zeroed]: mem::MaybeUninit::zeroed
672668
#[cfg(not(no_global_oom_handling))]
673-
#[unstable(feature = "new_zeroed_alloc", issue = "129396")]
669+
#[stable(feature = "new_zeroed_alloc", since = "CURRENT_RUSTC_VERSION")]
674670
#[must_use]
675671
pub fn new_zeroed_slice(len: usize) -> Box<[mem::MaybeUninit<T>]> {
676672
unsafe { RawVec::with_capacity_zeroed(len).into_box(len) }

‎library/alloc/src/rc.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,6 @@ impl<T> Rc<T> {
515515
/// # Examples
516516
///
517517
/// ```
518-
/// #![feature(new_zeroed_alloc)]
519-
///
520518
/// use std::rc::Rc;
521519
///
522520
/// let zero = Rc::<u32>::new_zeroed();
@@ -527,7 +525,7 @@ impl<T> Rc<T> {
527525
///
528526
/// [zeroed]: mem::MaybeUninit::zeroed
529527
#[cfg(not(no_global_oom_handling))]
530-
#[unstable(feature = "new_zeroed_alloc", issue = "129396")]
528+
#[stable(feature = "new_zeroed_alloc", since = "CURRENT_RUSTC_VERSION")]
531529
#[must_use]
532530
pub fn new_zeroed() -> Rc<mem::MaybeUninit<T>> {
533531
unsafe {
@@ -1054,8 +1052,6 @@ impl<T> Rc<[T]> {
10541052
/// # Examples
10551053
///
10561054
/// ```
1057-
/// #![feature(new_zeroed_alloc)]
1058-
///
10591055
/// use std::rc::Rc;
10601056
///
10611057
/// let values = Rc::<[u32]>::new_zeroed_slice(3);
@@ -1066,7 +1062,7 @@ impl<T> Rc<[T]> {
10661062
///
10671063
/// [zeroed]: mem::MaybeUninit::zeroed
10681064
#[cfg(not(no_global_oom_handling))]
1069-
#[unstable(feature = "new_zeroed_alloc", issue = "129396")]
1065+
#[stable(feature = "new_zeroed_alloc", since = "CURRENT_RUSTC_VERSION")]
10701066
#[must_use]
10711067
pub fn new_zeroed_slice(len: usize) -> Rc<[mem::MaybeUninit<T>]> {
10721068
unsafe {

‎library/alloc/src/sync.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,6 @@ impl<T> Arc<T> {
516516
/// # Examples
517517
///
518518
/// ```
519-
/// #![feature(new_zeroed_alloc)]
520-
///
521519
/// use std::sync::Arc;
522520
///
523521
/// let zero = Arc::<u32>::new_zeroed();
@@ -529,7 +527,7 @@ impl<T> Arc<T> {
529527
/// [zeroed]: mem::MaybeUninit::zeroed
530528
#[cfg(not(no_global_oom_handling))]
531529
#[inline]
532-
#[unstable(feature = "new_zeroed_alloc", issue = "129396")]
530+
#[stable(feature = "new_zeroed_alloc", since = "CURRENT_RUSTC_VERSION")]
533531
#[must_use]
534532
pub fn new_zeroed() -> Arc<mem::MaybeUninit<T>> {
535533
unsafe {
@@ -1197,8 +1195,6 @@ impl<T> Arc<[T]> {
11971195
/// # Examples
11981196
///
11991197
/// ```
1200-
/// #![feature(new_zeroed_alloc)]
1201-
///
12021198
/// use std::sync::Arc;
12031199
///
12041200
/// let values = Arc::<[u32]>::new_zeroed_slice(3);
@@ -1210,7 +1206,7 @@ impl<T> Arc<[T]> {
12101206
/// [zeroed]: mem::MaybeUninit::zeroed
12111207
#[cfg(not(no_global_oom_handling))]
12121208
#[inline]
1213-
#[unstable(feature = "new_zeroed_alloc", issue = "129396")]
1209+
#[stable(feature = "new_zeroed_alloc", since = "CURRENT_RUSTC_VERSION")]
12141210
#[must_use]
12151211
pub fn new_zeroed_slice(len: usize) -> Arc<[mem::MaybeUninit<T>]> {
12161212
unsafe {

‎library/std/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@
376376
#![feature(allocator_api)]
377377
#![feature(get_mut_unchecked)]
378378
#![feature(map_try_insert)]
379-
#![feature(new_zeroed_alloc)]
380379
#![feature(slice_concat_trait)]
381380
#![feature(thin_box)]
382381
#![feature(try_reserve_kind)]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /