diff --git a/library/alloc/src/collections/binary_heap.rs b/library/alloc/src/collections/binary_heap.rs index 8a29af3fe07e6..fb340734e0b7f 100644 --- a/library/alloc/src/collections/binary_heap.rs +++ b/library/alloc/src/collections/binary_heap.rs @@ -973,7 +973,6 @@ impl BinaryHeap { /// # Examples /// /// ``` - /// #![feature(shrink_to)] /// use std::collections::BinaryHeap; /// let mut heap: BinaryHeap = BinaryHeap::with_capacity(100); /// @@ -982,7 +981,7 @@ impl BinaryHeap { /// assert!(heap.capacity() >= 10); /// ``` #[inline] - #[unstable(feature = "shrink_to", reason = "new API", issue = "56431")] + #[stable(feature = "shrink_to", since = "1.56.0")] pub fn shrink_to(&mut self, min_capacity: usize) { self.data.shrink_to(min_capacity) } diff --git a/library/alloc/src/collections/vec_deque/mod.rs b/library/alloc/src/collections/vec_deque/mod.rs index bea5cf11be5e8..9a2205420a14b 100644 --- a/library/alloc/src/collections/vec_deque/mod.rs +++ b/library/alloc/src/collections/vec_deque/mod.rs @@ -816,7 +816,6 @@ impl VecDeque { /// # Examples /// /// ``` - /// #![feature(shrink_to)] /// use std::collections::VecDeque; /// /// let mut buf = VecDeque::with_capacity(15); @@ -827,7 +826,7 @@ impl VecDeque { /// buf.shrink_to(0); /// assert!(buf.capacity() >= 4); /// ``` - #[unstable(feature = "shrink_to", reason = "new API", issue = "56431")] + #[stable(feature = "shrink_to", since = "1.56.0")] pub fn shrink_to(&mut self, min_capacity: usize) { let min_capacity = cmp::min(min_capacity, self.capacity()); // We don't have to worry about an overflow as neither `self.len()` nor `self.capacity()` diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index a6b8bdef89c11..9aefd882af4e2 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -1100,7 +1100,6 @@ impl String { /// # Examples /// /// ``` - /// #![feature(shrink_to)] /// let mut s = String::from("foo"); /// /// s.reserve(100); @@ -1113,7 +1112,7 @@ impl String { /// ``` #[cfg(not(no_global_oom_handling))] #[inline] - #[unstable(feature = "shrink_to", reason = "new API", issue = "56431")] + #[stable(feature = "shrink_to", since = "1.56.0")] pub fn shrink_to(&mut self, min_capacity: usize) { self.vec.shrink_to(min_capacity) } diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index c54c91509d48b..e14ebd869a308 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -947,7 +947,6 @@ impl Vec { /// # Examples /// /// ``` - /// #![feature(shrink_to)] /// let mut vec = Vec::with_capacity(10); /// vec.extend([1, 2, 3]); /// assert_eq!(vec.capacity(), 10); @@ -957,7 +956,7 @@ impl Vec { /// assert!(vec.capacity() >= 3); /// ``` #[cfg(not(no_global_oom_handling))] - #[unstable(feature = "shrink_to", reason = "new API", issue = "56431")] + #[stable(feature = "shrink_to", since = "1.56.0")] pub fn shrink_to(&mut self, min_capacity: usize) { if self.capacity() > min_capacity { self.buf.shrink_to_fit(cmp::max(self.len, min_capacity)); diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index 941708429b985..7e8da13239c5f 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -667,7 +667,6 @@ where /// # Examples /// /// ``` - /// #![feature(shrink_to)] /// use std::collections::HashMap; /// /// let mut map: HashMap = HashMap::with_capacity(100); @@ -680,7 +679,7 @@ where /// assert!(map.capacity() >= 2); /// ``` #[inline] - #[unstable(feature = "shrink_to", reason = "new API", issue = "56431")] + #[stable(feature = "shrink_to", since = "1.56.0")] pub fn shrink_to(&mut self, min_capacity: usize) { self.base.shrink_to(min_capacity); } diff --git a/library/std/src/collections/hash/set.rs b/library/std/src/collections/hash/set.rs index c381481e006a9..3b61acd122e2e 100644 --- a/library/std/src/collections/hash/set.rs +++ b/library/std/src/collections/hash/set.rs @@ -464,7 +464,6 @@ where /// # Examples /// /// ``` - /// #![feature(shrink_to)] /// use std::collections::HashSet; /// /// let mut set = HashSet::with_capacity(100); @@ -477,7 +476,7 @@ where /// assert!(set.capacity() >= 2); /// ``` #[inline] - #[unstable(feature = "shrink_to", reason = "new API", issue = "56431")] + #[stable(feature = "shrink_to", since = "1.56.0")] pub fn shrink_to(&mut self, min_capacity: usize) { self.base.shrink_to(min_capacity) } diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index 84735345ac3b6..8f4cd6c691cf7 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -321,7 +321,6 @@ impl OsString { /// # Examples /// /// ``` - /// #![feature(shrink_to)] /// use std::ffi::OsString; /// /// let mut s = OsString::from("foo"); @@ -335,7 +334,7 @@ impl OsString { /// assert!(s.capacity() >= 3); /// ``` #[inline] - #[unstable(feature = "shrink_to", reason = "new API", issue = "56431")] + #[stable(feature = "shrink_to", since = "1.56.0")] pub fn shrink_to(&mut self, min_capacity: usize) { self.inner.shrink_to(min_capacity) } diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 1af6157ca68bf..861a6fc193cc8 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -308,7 +308,6 @@ #![feature(ptr_internals)] #![feature(rustc_attrs)] #![feature(rustc_private)] -#![feature(shrink_to)] #![feature(slice_concat_ext)] #![feature(slice_internals)] #![feature(slice_ptr_get)] diff --git a/library/std/src/path.rs b/library/std/src/path.rs index c71751efb9f9a..69419145b1b4f 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -1398,7 +1398,7 @@ impl PathBuf { /// Invokes [`shrink_to`] on the underlying instance of [`OsString`]. /// /// [`shrink_to`]: OsString::shrink_to - #[unstable(feature = "shrink_to", issue = "56431")] + #[stable(feature = "shrink_to", since = "1.56.0")] #[inline] pub fn shrink_to(&mut self, min_capacity: usize) { self.inner.shrink_to(min_capacity)