From edc412c5a9ce825d589dcb87dd6028b072139b51 Mon Sep 17 00:00:00 2001 From: tinaun Date: Tue, 17 Apr 2018 00:30:06 -0400 Subject: stabilize `slice_rsplit` feature --- src/liballoc/lib.rs | 1 - src/liballoc/slice.rs | 11 +++-------- 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 3a106a2ff5c..87ad2751c5b 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -108,7 +108,6 @@ #![feature(ptr_offset_from)] #![feature(rustc_attrs)] #![feature(slice_get_slice)] -#![feature(slice_rsplit)] #![feature(specialization)] #![feature(staged_api)] #![feature(str_internals)] diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index 56c53fca62c..eb8a293013d 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -116,7 +116,7 @@ pub use core::slice::{Iter, IterMut}; pub use core::slice::{SplitMut, ChunksMut, Split}; #[stable(feature = "rust1", since = "1.0.0")] pub use core::slice::{SplitN, RSplitN, SplitNMut, RSplitNMut}; -#[unstable(feature = "slice_rsplit", issue = "41020")] +#[stable(feature = "slice_rsplit", since = "1.27.0")] pub use core::slice::{RSplit, RSplitMut}; #[stable(feature = "rust1", since = "1.0.0")] pub use core::slice::{from_raw_parts, from_raw_parts_mut}; @@ -888,7 +888,6 @@ impl [T] { /// # Examples /// /// ``` - /// #![feature(slice_rsplit)] /// /// let slice = [11, 22, 33, 0, 44, 55]; /// let mut iter = slice.rsplit(|num| *num == 0); @@ -902,8 +901,6 @@ impl [T] { /// slice will be the first (or last) item returned by the iterator. /// /// ``` - /// #![feature(slice_rsplit)] - /// /// let v = &[0, 1, 1, 2, 3, 5, 8]; /// let mut it = v.rsplit(|n| *n % 2 == 0); /// assert_eq!(it.next().unwrap(), &[]); @@ -912,7 +909,7 @@ impl [T] { /// assert_eq!(it.next().unwrap(), &[]); /// assert_eq!(it.next(), None); /// ``` - #[unstable(feature = "slice_rsplit", issue = "41020")] + #[stable(feature = "slice_rsplit", since = "1.27.0")] #[inline] pub fn rsplit(&self, pred: F) -> RSplit where F: FnMut(&T) -> bool @@ -927,8 +924,6 @@ impl [T] { /// # Examples /// /// ``` - /// #![feature(slice_rsplit)] - /// /// let mut v = [100, 400, 300, 200, 600, 500]; /// /// let mut count = 0; @@ -939,7 +934,7 @@ impl [T] { /// assert_eq!(v, [3, 400, 300, 2, 600, 1]); /// ``` /// - #[unstable(feature = "slice_rsplit", issue = "41020")] + #[stable(feature = "slice_rsplit", since = "1.27.0")] #[inline] pub fn rsplit_mut(&mut self, pred: F) -> RSplitMut where F: FnMut(&T) -> bool -- cgit 1.4.1-3-g733a5 From 78a8c257032b18b5ca63f41b18d2fe7d57d1cffa Mon Sep 17 00:00:00 2001 From: tinaun Date: Tue, 17 Apr 2018 00:40:07 -0400 Subject: stabilize `swap_with_slice` feature --- src/liballoc/lib.rs | 2 +- src/liballoc/slice.rs | 8 +------- src/libcore/slice/mod.rs | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 87ad2751c5b..f2a61bda4aa 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -123,7 +123,7 @@ #![feature(inclusive_range_fields)] #![cfg_attr(stage0, feature(generic_param_attrs))] -#![cfg_attr(not(test), feature(fn_traits, swap_with_slice, i128))] +#![cfg_attr(not(test), feature(fn_traits, i128))] #![cfg_attr(test, feature(test))] // Allow testing this library diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index eb8a293013d..33e652856e8 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -1702,8 +1702,6 @@ impl [T] { /// Swapping two elements across slices: /// /// ``` - /// #![feature(swap_with_slice)] - /// /// let mut slice1 = [0, 0]; /// let mut slice2 = [1, 2, 3, 4]; /// @@ -1719,8 +1717,6 @@ impl [T] { /// a compile failure: /// /// ```compile_fail - /// #![feature(swap_with_slice)] - /// /// let mut slice = [1, 2, 3, 4, 5]; /// slice[..2].swap_with_slice(&mut slice[3..]); // compile fail! /// ``` @@ -1729,8 +1725,6 @@ impl [T] { /// mutable sub-slices from a slice: /// /// ``` - /// #![feature(swap_with_slice)] - /// /// let mut slice = [1, 2, 3, 4, 5]; /// /// { @@ -1742,7 +1736,7 @@ impl [T] { /// ``` /// /// [`split_at_mut`]: #method.split_at_mut - #[unstable(feature = "swap_with_slice", issue = "44030")] + #[stable(feature = "swap_with_slice", since = "1.27.0")] pub fn swap_with_slice(&mut self, other: &mut [T]) { core_slice::SliceExt::swap_with_slice(self, other) } diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index 68f081c2e87..afb149f2997 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -223,7 +223,7 @@ pub trait SliceExt { #[stable(feature = "copy_from_slice", since = "1.9.0")] fn copy_from_slice(&mut self, src: &[Self::Item]) where Self::Item: Copy; - #[unstable(feature = "swap_with_slice", issue = "44030")] + #[stable(feature = "swap_with_slice", since = "1.27.0")] fn swap_with_slice(&mut self, src: &mut [Self::Item]); #[stable(feature = "sort_unstable", since = "1.20.0")] -- cgit 1.4.1-3-g733a5 From b84baf23788e96a1d79de543eb264ff7d2334c63 Mon Sep 17 00:00:00 2001 From: tinaun Date: Tue, 17 Apr 2018 00:59:16 -0400 Subject: stabilize `nonnull_cast` feature --- src/liballoc/lib.rs | 1 - src/libcore/ptr.rs | 2 +- src/libstd/lib.rs | 1 - src/test/run-pass/realloc-16687.rs | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index f2a61bda4aa..163aef61b43 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -99,7 +99,6 @@ #![feature(lang_items)] #![feature(libc)] #![feature(needs_allocator)] -#![feature(nonnull_cast)] #![feature(nonzero)] #![feature(optin_builtin_traits)] #![feature(pattern)] diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index f953b29fdc8..74bb264cc67 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -2742,7 +2742,7 @@ impl NonNull { } /// Cast to a pointer of another type - #[unstable(feature = "nonnull_cast", issue = "47653")] + #[stable(feature = "nonnull_cast", since = "1.27.0")] pub fn cast(self) -> NonNull { unsafe { NonNull::new_unchecked(self.as_ptr() as *mut U) diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index dd96c57538c..63e4a17d32e 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -275,7 +275,6 @@ #![feature(macro_reexport)] #![feature(macro_vis_matcher)] #![feature(needs_panic_runtime)] -#![feature(nonnull_cast)] #![feature(exhaustive_patterns)] #![feature(nonzero)] #![feature(num_bits_bytes)] diff --git a/src/test/run-pass/realloc-16687.rs b/src/test/run-pass/realloc-16687.rs index 38cc23c16a9..afa3494c389 100644 --- a/src/test/run-pass/realloc-16687.rs +++ b/src/test/run-pass/realloc-16687.rs @@ -13,7 +13,7 @@ // Ideally this would be revised to use no_std, but for now it serves // well enough to reproduce (and illustrate) the bug from #16687. -#![feature(heap_api, allocator_api, nonnull_cast)] +#![feature(heap_api, allocator_api)] use std::alloc::{Global, Alloc, Layout}; use std::ptr::{self, NonNull}; -- cgit 1.4.1-3-g733a5