Skip to content

Commit 0edc3d3

Browse files
committed
Rollup merge of rust-lang#39307 - alexcrichton:stabilize-1.16, r=brson
std: Stabilize APIs for the 1.16.0 release This commit applies the stabilization/deprecations of the 1.16.0 release, as tracked by the rust-lang/rust issue tracker and the final-comment-period tag. The following APIs were stabilized: * `VecDeque::truncate` * `VecDeque::resize` * `String::insert_str` * `Duration::checked_{add,sub,div,mul}` * `str::replacen` * `SocketAddr::is_ipv{4,6}` * `IpAddr::is_ipv{4,6}` * `str::repeat` * `Vec::dedup_by` * `Vec::dedup_by_key` * `Result::unwrap_or_default` * `<*const T>::wrapping_offset` * `<*mut T>::wrapping_offset` * `CommandExt::creation_flags` (on Windows) * `File::set_permissions` * `String::split_off` The following APIs were deprecated * `EnumSet` - replaced with other ecosystem abstractions, long since unstable Closes rust-lang#27788 Closes rust-lang#35553 Closes rust-lang#35774 Closes rust-lang#36436 Closes rust-lang#36949 Closes rust-lang#37079 Closes rust-lang#37087 Closes rust-lang#37516 Closes rust-lang#37827 Closes rust-lang#37916 Closes rust-lang#37966 Closes rust-lang#38080
2 parents 13e3b36 + 671b1c1 commit 0edc3d3

File tree

18 files changed

+26
-371
lines changed

18 files changed

+26
-371
lines changed

src/libcollections/enum_set.rs

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
reason = "matches collection reform specification, \
1818
waiting for dust to settle",
1919
issue = "37966")]
20+
#![rustc_deprecated(since = "1.16.0", reason = "long since replaced")]
21+
#![allow(deprecated)]
2022

2123
use core::marker;
2224
use core::fmt;

src/libcollections/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ pub use btree_set::BTreeSet;
7979
#[doc(no_inline)]
8080
pub use linked_list::LinkedList;
8181
#[doc(no_inline)]
82+
#[allow(deprecated)]
8283
pub use enum_set::EnumSet;
8384
#[doc(no_inline)]
8485
pub use vec_deque::VecDeque;

src/libcollections/str.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,6 @@ impl str {
16071607
/// Basic usage:
16081608
///
16091609
/// ```
1610-
/// # #![feature(str_replacen)]
16111610
/// let s = "foo foo 123 foo";
16121611
/// assert_eq!("new new 123 foo", s.replacen("foo", "new", 2));
16131612
/// assert_eq!("faa fao 123 foo", s.replacen('o', "a", 3));
@@ -1617,13 +1616,10 @@ impl str {
16171616
/// When the pattern doesn't match:
16181617
///
16191618
/// ```
1620-
/// # #![feature(str_replacen)]
16211619
/// let s = "this is old";
16221620
/// assert_eq!(s, s.replacen("cookie monster", "little lamb", 10));
16231621
/// ```
1624-
#[unstable(feature = "str_replacen",
1625-
issue = "36436",
1626-
reason = "only need to replace first N matches")]
1622+
#[stable(feature = "str_replacen", since = "1.16.0")]
16271623
pub fn replacen<'a, P: Pattern<'a>>(&'a self, pat: P, to: &str, count: usize) -> String {
16281624
// Hope to reduce the times of re-allocation
16291625
let mut result = String::with_capacity(32);
@@ -1795,11 +1791,9 @@ impl str {
17951791
/// Basic usage:
17961792
///
17971793
/// ```
1798-
/// #![feature(repeat_str)]
1799-
///
18001794
/// assert_eq!("abc".repeat(4), String::from("abcabcabcabc"));
18011795
/// ```
1802-
#[unstable(feature = "repeat_str", issue = "37079")]
1796+
#[stable(feature = "repeat_str", since = "1.16.0")]
18031797
pub fn repeat(&self, n: usize) -> String {
18041798
let mut s = String::with_capacity(self.len() * n);
18051799
s.extend((0..n).map(|_| self));

src/libcollections/string.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -1166,18 +1166,14 @@ impl String {
11661166
/// Basic usage:
11671167
///
11681168
/// ```
1169-
/// #![feature(insert_str)]
1170-
///
11711169
/// let mut s = String::from("bar");
11721170
///
11731171
/// s.insert_str(0, "foo");
11741172
///
11751173
/// assert_eq!("foobar", s);
11761174
/// ```
11771175
#[inline]
1178-
#[unstable(feature = "insert_str",
1179-
reason = "recent addition",
1180-
issue = "35553")]
1176+
#[stable(feature = "insert_str", since = "1.16.0")]
11811177
pub fn insert_str(&mut self, idx: usize, string: &str) {
11821178
assert!(self.is_char_boundary(idx));
11831179

@@ -1270,7 +1266,6 @@ impl String {
12701266
/// # Examples
12711267
///
12721268
/// ```
1273-
/// # #![feature(string_split_off)]
12741269
/// # fn main() {
12751270
/// let mut hello = String::from("Hello, World!");
12761271
/// let world = hello.split_off(7);
@@ -1279,7 +1274,7 @@ impl String {
12791274
/// # }
12801275
/// ```
12811276
#[inline]
1282-
#[unstable(feature = "string_split_off", issue = "38080")]
1277+
#[stable(feature = "string_split_off", since = "1.16.0")]
12831278
pub fn split_off(&mut self, mid: usize) -> String {
12841279
assert!(self.is_char_boundary(mid));
12851280
let other = self.vec.split_off(mid);

src/libcollections/vec.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -820,15 +820,13 @@ impl<T> Vec<T> {
820820
/// # Examples
821821
///
822822
/// ```
823-
/// #![feature(dedup_by)]
824-
///
825823
/// let mut vec = vec![10, 20, 21, 30, 20];
826824
///
827825
/// vec.dedup_by_key(|i| *i / 10);
828826
///
829827
/// assert_eq!(vec, [10, 20, 30, 20]);
830828
/// ```
831-
#[unstable(feature = "dedup_by", reason = "recently added", issue = "37087")]
829+
#[stable(feature = "dedup_by", since = "1.16.0")]
832830
#[inline]
833831
pub fn dedup_by_key<F, K>(&mut self, mut key: F) where F: FnMut(&mut T) -> K, K: PartialEq {
834832
self.dedup_by(|a, b| key(a) == key(b))
@@ -841,7 +839,6 @@ impl<T> Vec<T> {
841839
/// # Examples
842840
///
843841
/// ```
844-
/// #![feature(dedup_by)]
845842
/// use std::ascii::AsciiExt;
846843
///
847844
/// let mut vec = vec!["foo", "bar", "Bar", "baz", "bar"];
@@ -850,7 +847,7 @@ impl<T> Vec<T> {
850847
///
851848
/// assert_eq!(vec, ["foo", "bar", "baz", "bar"]);
852849
/// ```
853-
#[unstable(feature = "dedup_by", reason = "recently added", issue = "37087")]
850+
#[stable(feature = "dedup_by", since = "1.16.0")]
854851
pub fn dedup_by<F>(&mut self, mut same_bucket: F) where F: FnMut(&mut T, &mut T) -> bool {
855852
unsafe {
856853
// Although we have a mutable reference to `self`, we cannot make

src/libcollections/vec_deque.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,6 @@ impl<T> VecDeque<T> {
643643
/// # Examples
644644
///
645645
/// ```
646-
/// #![feature(deque_extras)]
647-
///
648646
/// use std::collections::VecDeque;
649647
///
650648
/// let mut buf = VecDeque::new();
@@ -655,9 +653,7 @@ impl<T> VecDeque<T> {
655653
/// assert_eq!(buf.len(), 1);
656654
/// assert_eq!(Some(&5), buf.get(0));
657655
/// ```
658-
#[unstable(feature = "deque_extras",
659-
reason = "matches collection reform specification; waiting on panic semantics",
660-
issue = "27788")]
656+
#[stable(feature = "deque_extras", since = "1.16.0")]
661657
pub fn truncate(&mut self, len: usize) {
662658
for _ in len..self.len() {
663659
self.pop_back();
@@ -1779,8 +1775,6 @@ impl<T: Clone> VecDeque<T> {
17791775
/// # Examples
17801776
///
17811777
/// ```
1782-
/// #![feature(deque_extras)]
1783-
///
17841778
/// use std::collections::VecDeque;
17851779
///
17861780
/// let mut buf = VecDeque::new();
@@ -1793,9 +1787,7 @@ impl<T: Clone> VecDeque<T> {
17931787
/// assert_eq!(a, b);
17941788
/// }
17951789
/// ```
1796-
#[unstable(feature = "deque_extras",
1797-
reason = "matches collection reform specification; waiting on panic semantics",
1798-
issue = "27788")]
1790+
#[stable(feature = "deque_extras", since = "1.16.0")]
17991791
pub fn resize(&mut self, new_len: usize, value: T) {
18001792
let len = self.len();
18011793

0 commit comments

Comments
 (0)