Skip to content

Commit f4f1140

Browse files
committed
stabilize slice_align_to
1 parent b638d8c commit f4f1140

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/libcore/slice/mod.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1744,8 +1744,9 @@ impl<T> [T] {
17441744
/// maintained.
17451745
///
17461746
/// This method splits the slice into three distinct slices: prefix, correctly aligned middle
1747-
/// slice of a new type, and the suffix slice. The middle slice will have the greatest length
1748-
/// possible for a given type and input slice.
1747+
/// slice of a new type, and the suffix slice. The method does a best effort to make the
1748+
/// middle slice the greatest length possible for a given type and input slice, but only
1749+
/// your algorithm's performance should depend on that, not its correctness.
17491750
///
17501751
/// This method has no purpose when either input element `T` or output element `U` are
17511752
/// zero-sized and will return the original slice without splitting anything.
@@ -1760,7 +1761,6 @@ impl<T> [T] {
17601761
/// Basic usage:
17611762
///
17621763
/// ```
1763-
/// # #![feature(slice_align_to)]
17641764
/// unsafe {
17651765
/// let bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
17661766
/// let (prefix, shorts, suffix) = bytes.align_to::<u16>();
@@ -1769,7 +1769,7 @@ impl<T> [T] {
17691769
/// // less_efficient_algorithm_for_bytes(suffix);
17701770
/// }
17711771
/// ```
1772-
#[unstable(feature = "slice_align_to", issue = "44488")]
1772+
#[stable(feature = "slice_align_to", since = "1.30.0")]
17731773
pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T]) {
17741774
// Note that most of this function will be constant-evaluated,
17751775
if ::mem::size_of::<U>() == 0 || ::mem::size_of::<T>() == 0 {
@@ -1797,8 +1797,9 @@ impl<T> [T] {
17971797
/// maintained.
17981798
///
17991799
/// This method splits the slice into three distinct slices: prefix, correctly aligned middle
1800-
/// slice of a new type, and the suffix slice. The middle slice will have the greatest length
1801-
/// possible for a given type and input slice.
1800+
/// slice of a new type, and the suffix slice. The method does a best effort to make the
1801+
/// middle slice the greatest length possible for a given type and input slice, but only
1802+
/// your algorithm's performance should depend on that, not its correctness.
18021803
///
18031804
/// This method has no purpose when either input element `T` or output element `U` are
18041805
/// zero-sized and will return the original slice without splitting anything.
@@ -1813,7 +1814,6 @@ impl<T> [T] {
18131814
/// Basic usage:
18141815
///
18151816
/// ```
1816-
/// # #![feature(slice_align_to)]
18171817
/// unsafe {
18181818
/// let mut bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
18191819
/// let (prefix, shorts, suffix) = bytes.align_to_mut::<u16>();
@@ -1822,7 +1822,7 @@ impl<T> [T] {
18221822
/// // less_efficient_algorithm_for_bytes(suffix);
18231823
/// }
18241824
/// ```
1825-
#[unstable(feature = "slice_align_to", issue = "44488")]
1825+
#[stable(feature = "slice_align_to", since = "1.30.0")]
18261826
pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T]) {
18271827
// Note that most of this function will be constant-evaluated,
18281828
if ::mem::size_of::<U>() == 0 || ::mem::size_of::<T>() == 0 {

src/libcore/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#![feature(try_from)]
3535
#![feature(try_trait)]
3636
#![feature(exact_chunks)]
37-
#![feature(slice_align_to)]
3837
#![feature(align_offset)]
3938
#![feature(reverse_bits)]
4039
#![feature(inner_deref)]

0 commit comments

Comments
 (0)