Merge from rustc · patricklam/verify-rust-std@5c4c81a

@@ -262,8 +262,6 @@ impl<T> Box<T> {

262262

/// # Examples

263263

///

264264

/// ```

265-

/// #![feature(new_uninit)]

266-

///

267265

/// let mut five = Box::<u32>::new_uninit();

268266

///

269267

/// let five = unsafe {

@@ -276,7 +274,7 @@ impl<T> Box<T> {

276274

/// assert_eq!(*five, 5)

277275

/// ```

278276

#[cfg(not(no_global_oom_handling))]

279-

#[unstable(feature = "new_uninit", issue = "63291")]

277+

#[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")]

280278

#[must_use]

281279

#[inline]

282280

pub fn new_uninit() -> Box<mem::MaybeUninit<T>> {

@@ -292,7 +290,6 @@ impl<T> Box<T> {

292290

/// # Examples

293291

///

294292

/// ```

295-

/// #![feature(new_uninit)]

296293

/// #![feature(new_zeroed_alloc)]

297294

///

298295

/// let zero = Box::<u32>::new_zeroed();

@@ -350,7 +347,7 @@ impl<T> Box<T> {

350347

/// # Examples

351348

///

352349

/// ```

353-

/// #![feature(allocator_api, new_uninit)]

350+

/// #![feature(allocator_api)]

354351

///

355352

/// let mut five = Box::<u32>::try_new_uninit()?;

356353

///

@@ -380,7 +377,7 @@ impl<T> Box<T> {

380377

/// # Examples

381378

///

382379

/// ```

383-

/// #![feature(allocator_api, new_uninit)]

380+

/// #![feature(allocator_api)]

384381

///

385382

/// let zero = Box::<u32>::try_new_zeroed()?;

386383

/// let zero = unsafe { zero.assume_init() };

@@ -460,7 +457,7 @@ impl<T, A: Allocator> Box<T, A> {

460457

/// # Examples

461458

///

462459

/// ```

463-

/// #![feature(allocator_api, new_uninit)]

460+

/// #![feature(allocator_api)]

464461

///

465462

/// use std::alloc::System;

466463

///

@@ -498,7 +495,7 @@ impl<T, A: Allocator> Box<T, A> {

498495

/// # Examples

499496

///

500497

/// ```

501-

/// #![feature(allocator_api, new_uninit)]

498+

/// #![feature(allocator_api)]

502499

///

503500

/// use std::alloc::System;

504501

///

@@ -538,7 +535,7 @@ impl<T, A: Allocator> Box<T, A> {

538535

/// # Examples

539536

///

540537

/// ```

541-

/// #![feature(allocator_api, new_uninit)]

538+

/// #![feature(allocator_api)]

542539

///

543540

/// use std::alloc::System;

544541

///

@@ -576,7 +573,7 @@ impl<T, A: Allocator> Box<T, A> {

576573

/// # Examples

577574

///

578575

/// ```

579-

/// #![feature(allocator_api, new_uninit)]

576+

/// #![feature(allocator_api)]

580577

///

581578

/// use std::alloc::System;

582579

///

@@ -654,8 +651,6 @@ impl<T> Box<[T]> {

654651

/// # Examples

655652

///

656653

/// ```

657-

/// #![feature(new_uninit)]

658-

///

659654

/// let mut values = Box::<[u32]>::new_uninit_slice(3);

660655

///

661656

/// let values = unsafe {

@@ -670,7 +665,7 @@ impl<T> Box<[T]> {

670665

/// assert_eq!(*values, [1, 2, 3])

671666

/// ```

672667

#[cfg(not(no_global_oom_handling))]

673-

#[unstable(feature = "new_uninit", issue = "63291")]

668+

#[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")]

674669

#[must_use]

675670

pub fn new_uninit_slice(len: usize) -> Box<[mem::MaybeUninit<T>]> {

676671

unsafe { RawVec::with_capacity(len).into_box(len) }

@@ -686,7 +681,6 @@ impl<T> Box<[T]> {

686681

///

687682

/// ```

688683

/// #![feature(new_zeroed_alloc)]

689-

/// #![feature(new_uninit)]

690684

///

691685

/// let values = Box::<[u32]>::new_zeroed_slice(3);

692686

/// let values = unsafe { values.assume_init() };

@@ -708,7 +702,7 @@ impl<T> Box<[T]> {

708702

/// # Examples

709703

///

710704

/// ```

711-

/// #![feature(allocator_api, new_uninit)]

705+

/// #![feature(allocator_api)]

712706

///

713707

/// let mut values = Box::<[u32]>::try_new_uninit_slice(3)?;

714708

/// let values = unsafe {

@@ -746,7 +740,7 @@ impl<T> Box<[T]> {

746740

/// # Examples

747741

///

748742

/// ```

749-

/// #![feature(allocator_api, new_uninit)]

743+

/// #![feature(allocator_api)]

750744

///

751745

/// let values = Box::<[u32]>::try_new_zeroed_slice(3)?;

752746

/// let values = unsafe { values.assume_init() };

@@ -778,7 +772,7 @@ impl<T, A: Allocator> Box<[T], A> {

778772

/// # Examples

779773

///

780774

/// ```

781-

/// #![feature(allocator_api, new_uninit)]

775+

/// #![feature(allocator_api)]

782776

///

783777

/// use std::alloc::System;

784778

///

@@ -812,7 +806,7 @@ impl<T, A: Allocator> Box<[T], A> {

812806

/// # Examples

813807

///

814808

/// ```

815-

/// #![feature(allocator_api, new_uninit)]

809+

/// #![feature(allocator_api)]

816810

///

817811

/// use std::alloc::System;

818812

///

@@ -837,7 +831,7 @@ impl<T, A: Allocator> Box<[T], A> {

837831

/// # Examples

838832

///

839833

/// ```

840-

/// #![feature(allocator_api, new_uninit)]

834+

/// #![feature(allocator_api)]

841835

///

842836

/// use std::alloc::System;

843837

///

@@ -880,7 +874,7 @@ impl<T, A: Allocator> Box<[T], A> {

880874

/// # Examples

881875

///

882876

/// ```

883-

/// #![feature(allocator_api, new_uninit)]

877+

/// #![feature(allocator_api)]

884878

///

885879

/// use std::alloc::System;

886880

///

@@ -927,8 +921,6 @@ impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> {

927921

/// # Examples

928922

///

929923

/// ```

930-

/// #![feature(new_uninit)]

931-

///

932924

/// let mut five = Box::<u32>::new_uninit();

933925

///

934926

/// let five: Box<u32> = unsafe {

@@ -940,7 +932,7 @@ impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> {

940932

///

941933

/// assert_eq!(*five, 5)

942934

/// ```

943-

#[unstable(feature = "new_uninit", issue = "63291")]

935+

#[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")]

944936

#[inline]

945937

pub unsafe fn assume_init(self) -> Box<T, A> {

946938

let (raw, alloc) = Box::into_raw_with_allocator(self);

@@ -958,7 +950,6 @@ impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> {

958950

///

959951

/// ```

960952

/// #![feature(box_uninit_write)]

961-

/// #![feature(new_uninit)]

962953

///

963954

/// let big_box = Box::<[usize; 1024]>::new_uninit();

964955

///

@@ -1001,8 +992,6 @@ impl<T, A: Allocator> Box<[mem::MaybeUninit<T>], A> {

1001992

/// # Examples

1002993

///

1003994

/// ```

1004-

/// #![feature(new_uninit)]

1005-

///

1006995

/// let mut values = Box::<[u32]>::new_uninit_slice(3);

1007996

///

1008997

/// let values = unsafe {

@@ -1016,7 +1005,7 @@ impl<T, A: Allocator> Box<[mem::MaybeUninit<T>], A> {

10161005

///

10171006

/// assert_eq!(*values, [1, 2, 3])

10181007

/// ```

1019-

#[unstable(feature = "new_uninit", issue = "63291")]

1008+

#[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")]

10201009

#[inline]

10211010

pub unsafe fn assume_init(self) -> Box<[T], A> {

10221011

let (raw, alloc) = Box::into_raw_with_allocator(self);