Skip to content

Commit 0b5107f

Browse files
committed
Revert "Rollup merge of rust-lang#147540 - bjoernager:slice-as-array, r=Amanieu"
This reverts commit da2e3aa, reversing changes made to 0f786bd.
1 parent 4429659 commit 0b5107f

9 files changed

Lines changed: 14 additions & 16 deletions

File tree

compiler/rustc_codegen_llvm/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#![feature(iter_intersperse)]
1212
#![feature(macro_derive)]
1313
#![feature(once_cell_try)]
14+
#![feature(slice_as_array)]
1415
#![feature(trim_prefix_suffix)]
1516
#![feature(try_blocks)]
1617
// tidy-alphabetical-end

library/alloc/src/boxed.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,12 +1149,12 @@ impl<T, A: Allocator> Box<[T], A> {
11491149
/// # Examples
11501150
///
11511151
/// ```
1152-
/// #![feature(alloc_slice_into_array)]
1152+
/// #![feature(slice_as_array)]
11531153
/// let box_slice: Box<[i32]> = Box::new([1, 2, 3]);
11541154
///
11551155
/// let box_array: Box<[i32; 3]> = box_slice.into_array().unwrap();
11561156
/// ```
1157-
#[unstable(feature = "alloc_slice_into_array", issue = "148082")]
1157+
#[unstable(feature = "slice_as_array", issue = "133508")]
11581158
#[inline]
11591159
#[must_use]
11601160
pub fn into_array<const N: usize>(self) -> Result<Box<[T; N], A>, Self> {

library/alloc/src/rc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,14 +1246,14 @@ impl<T, A: Allocator> Rc<[T], A> {
12461246
/// # Examples
12471247
///
12481248
/// ```
1249-
/// #![feature(alloc_slice_into_array)]
1249+
/// #![feature(slice_as_array)]
12501250
/// use std::rc::Rc;
12511251
///
12521252
/// let rc_slice: Rc<[i32]> = Rc::new([1, 2, 3]);
12531253
///
12541254
/// let rc_array: Rc<[i32; 3]> = rc_slice.into_array().unwrap();
12551255
/// ```
1256-
#[unstable(feature = "alloc_slice_into_array", issue = "148082")]
1256+
#[unstable(feature = "slice_as_array", issue = "133508")]
12571257
#[inline]
12581258
#[must_use]
12591259
pub fn into_array<const N: usize>(self) -> Result<Rc<[T; N], A>, Self> {

library/alloc/src/sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,14 +1397,14 @@ impl<T, A: Allocator> Arc<[T], A> {
13971397
/// # Examples
13981398
///
13991399
/// ```
1400-
/// #![feature(alloc_slice_into_array)]
1400+
/// #![feature(slice_as_array)]
14011401
/// use std::sync::Arc;
14021402
///
14031403
/// let arc_slice: Arc<[i32]> = Arc::new([1, 2, 3]);
14041404
///
14051405
/// let arc_array: Arc<[i32; 3]> = arc_slice.into_array().unwrap();
14061406
/// ```
1407-
#[unstable(feature = "alloc_slice_into_array", issue = "148082")]
1407+
#[unstable(feature = "slice_as_array", issue = "133508")]
14081408
#[inline]
14091409
#[must_use]
14101410
pub fn into_array<const N: usize>(self) -> Result<Arc<[T; N], A>, Self> {

library/alloc/src/vec/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,14 +1749,14 @@ impl<T, A: Allocator> Vec<T, A> {
17491749
/// # Examples
17501750
///
17511751
/// ```
1752-
/// #![feature(alloc_slice_into_array)]
1752+
/// #![feature(slice_as_array)]
17531753
/// let vec: Vec<i32> = vec![1, 2, 3];
17541754
/// let box_array: Box<[i32; 3]> = vec.clone().into_array().unwrap();
17551755
/// let not_enough_elements: Result<Box<[i32; 4]>, Vec<i32>> = vec.into_array::<4>();
17561756
/// assert_eq!(not_enough_elements, Err(vec![1, 2, 3]));
17571757
/// ```
17581758
#[cfg(not(no_global_oom_handling))]
1759-
#[unstable(feature = "alloc_slice_into_array", issue = "148082")]
1759+
#[unstable(feature = "slice_as_array", issue = "133508")]
17601760
#[must_use]
17611761
pub fn into_array<const N: usize>(self) -> Result<Box<[T; N], A>, Self> {
17621762
if self.len() == N {

library/core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
#![feature(offset_of_enum)]
112112
#![feature(panic_internals)]
113113
#![feature(pattern_type_macro)]
114+
#![feature(slice_as_array)]
114115
#![feature(ub_checks)]
115116
// tidy-alphabetical-end
116117
//

library/core/src/ptr/const_ptr.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,8 +1481,7 @@ impl<T> *const [T] {
14811481
/// Gets a raw pointer to the underlying array.
14821482
///
14831483
/// If `N` is not exactly equal to the length of `self`, then this method returns `None`.
1484-
#[stable(feature = "core_slice_as_array", since = "1.93.0")]
1485-
#[rustc_const_stable(feature = "core_slice_as_array", since = "1.93.0")]
1484+
#[unstable(feature = "slice_as_array", issue = "133508")]
14861485
#[inline]
14871486
#[must_use]
14881487
pub const fn as_array<const N: usize>(self) -> Option<*const [T; N]> {

library/core/src/ptr/mut_ptr.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,8 +1740,7 @@ impl<T> *mut [T] {
17401740
/// Gets a raw, mutable pointer to the underlying array.
17411741
///
17421742
/// If `N` is not exactly equal to the length of `self`, then this method returns `None`.
1743-
#[stable(feature = "core_slice_as_array", since = "1.93.0")]
1744-
#[rustc_const_stable(feature = "core_slice_as_array", since = "1.93.0")]
1743+
#[unstable(feature = "slice_as_array", issue = "133508")]
17451744
#[inline]
17461745
#[must_use]
17471746
pub const fn as_mut_array<const N: usize>(self) -> Option<*mut [T; N]> {

library/core/src/slice/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,7 @@ impl<T> [T] {
846846
/// Gets a reference to the underlying array.
847847
///
848848
/// If `N` is not exactly equal to the length of `self`, then this method returns `None`.
849-
#[stable(feature = "core_slice_as_array", since = "1.93.0")]
850-
#[rustc_const_stable(feature = "core_slice_as_array", since = "1.93.0")]
849+
#[unstable(feature = "slice_as_array", issue = "133508")]
851850
#[inline]
852851
#[must_use]
853852
pub const fn as_array<const N: usize>(&self) -> Option<&[T; N]> {
@@ -865,8 +864,7 @@ impl<T> [T] {
865864
/// Gets a mutable reference to the slice's underlying array.
866865
///
867866
/// If `N` is not exactly equal to the length of `self`, then this method returns `None`.
868-
#[stable(feature = "core_slice_as_array", since = "1.93.0")]
869-
#[rustc_const_stable(feature = "core_slice_as_array", since = "1.93.0")]
867+
#[unstable(feature = "slice_as_array", issue = "133508")]
870868
#[inline]
871869
#[must_use]
872870
pub const fn as_mut_array<const N: usize>(&mut self) -> Option<&mut [T; N]> {

0 commit comments

Comments
 (0)