Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std: Stabilize APIs for the 1.16.0 release #39307

Merged
merged 1 commit into from
Jan 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/libcollections/enum_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
reason = "matches collection reform specification, \
waiting for dust to settle",
issue = "37966")]
#![rustc_deprecated(since = "1.16.0", reason = "long since replaced")]
#![allow(deprecated)]

use core::marker;
use core::fmt;
Expand Down
1 change: 1 addition & 0 deletions src/libcollections/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ pub use btree_set::BTreeSet;
#[doc(no_inline)]
pub use linked_list::LinkedList;
#[doc(no_inline)]
#[allow(deprecated)]
pub use enum_set::EnumSet;
#[doc(no_inline)]
pub use vec_deque::VecDeque;
Expand Down
10 changes: 2 additions & 8 deletions src/libcollections/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,6 @@ impl str {
/// Basic usage:
///
/// ```
/// # #![feature(str_replacen)]
/// let s = "foo foo 123 foo";
/// assert_eq!("new new 123 foo", s.replacen("foo", "new", 2));
/// assert_eq!("faa fao 123 foo", s.replacen('o', "a", 3));
Expand All @@ -1617,13 +1616,10 @@ impl str {
/// When the pattern doesn't match:
///
/// ```
/// # #![feature(str_replacen)]
/// let s = "this is old";
/// assert_eq!(s, s.replacen("cookie monster", "little lamb", 10));
/// ```
#[unstable(feature = "str_replacen",
issue = "36436",
reason = "only need to replace first N matches")]
#[stable(feature = "str_replacen", since = "1.16.0")]
pub fn replacen<'a, P: Pattern<'a>>(&'a self, pat: P, to: &str, count: usize) -> String {
// Hope to reduce the times of re-allocation
let mut result = String::with_capacity(32);
Expand Down Expand Up @@ -1795,11 +1791,9 @@ impl str {
/// Basic usage:
///
/// ```
/// #![feature(repeat_str)]
///
/// assert_eq!("abc".repeat(4), String::from("abcabcabcabc"));
/// ```
#[unstable(feature = "repeat_str", issue = "37079")]
#[stable(feature = "repeat_str", since = "1.16.0")]
pub fn repeat(&self, n: usize) -> String {
let mut s = String::with_capacity(self.len() * n);
s.extend((0..n).map(|_| self));
Expand Down
9 changes: 2 additions & 7 deletions src/libcollections/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1166,18 +1166,14 @@ impl String {
/// Basic usage:
///
/// ```
/// #![feature(insert_str)]
///
/// let mut s = String::from("bar");
///
/// s.insert_str(0, "foo");
///
/// assert_eq!("foobar", s);
/// ```
#[inline]
#[unstable(feature = "insert_str",
reason = "recent addition",
issue = "35553")]
#[stable(feature = "insert_str", since = "1.16.0")]
pub fn insert_str(&mut self, idx: usize, string: &str) {
assert!(self.is_char_boundary(idx));

Expand Down Expand Up @@ -1270,7 +1266,6 @@ impl String {
/// # Examples
///
/// ```
/// # #![feature(string_split_off)]
/// # fn main() {
/// let mut hello = String::from("Hello, World!");
/// let world = hello.split_off(7);
Expand All @@ -1279,7 +1274,7 @@ impl String {
/// # }
/// ```
#[inline]
#[unstable(feature = "string_split_off", issue = "38080")]
#[stable(feature = "string_split_off", since = "1.16.0")]
pub fn split_off(&mut self, mid: usize) -> String {
assert!(self.is_char_boundary(mid));
let other = self.vec.split_off(mid);
Expand Down
7 changes: 2 additions & 5 deletions src/libcollections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -820,15 +820,13 @@ impl<T> Vec<T> {
/// # Examples
///
/// ```
/// #![feature(dedup_by)]
///
/// let mut vec = vec![10, 20, 21, 30, 20];
///
/// vec.dedup_by_key(|i| *i / 10);
///
/// assert_eq!(vec, [10, 20, 30, 20]);
/// ```
#[unstable(feature = "dedup_by", reason = "recently added", issue = "37087")]
#[stable(feature = "dedup_by", since = "1.16.0")]
#[inline]
pub fn dedup_by_key<F, K>(&mut self, mut key: F) where F: FnMut(&mut T) -> K, K: PartialEq {
self.dedup_by(|a, b| key(a) == key(b))
Expand All @@ -841,7 +839,6 @@ impl<T> Vec<T> {
/// # Examples
///
/// ```
/// #![feature(dedup_by)]
/// use std::ascii::AsciiExt;
///
/// let mut vec = vec!["foo", "bar", "Bar", "baz", "bar"];
Expand All @@ -850,7 +847,7 @@ impl<T> Vec<T> {
///
/// assert_eq!(vec, ["foo", "bar", "baz", "bar"]);
/// ```
#[unstable(feature = "dedup_by", reason = "recently added", issue = "37087")]
#[stable(feature = "dedup_by", since = "1.16.0")]
pub fn dedup_by<F>(&mut self, mut same_bucket: F) where F: FnMut(&mut T, &mut T) -> bool {
unsafe {
// Although we have a mutable reference to `self`, we cannot make
Expand Down
12 changes: 2 additions & 10 deletions src/libcollections/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,6 @@ impl<T> VecDeque<T> {
/// # Examples
///
/// ```
/// #![feature(deque_extras)]
///
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
Expand All @@ -655,9 +653,7 @@ impl<T> VecDeque<T> {
/// assert_eq!(buf.len(), 1);
/// assert_eq!(Some(&5), buf.get(0));
/// ```
#[unstable(feature = "deque_extras",
reason = "matches collection reform specification; waiting on panic semantics",
issue = "27788")]
#[stable(feature = "deque_extras", since = "1.16.0")]
pub fn truncate(&mut self, len: usize) {
for _ in len..self.len() {
self.pop_back();
Expand Down Expand Up @@ -1779,8 +1775,6 @@ impl<T: Clone> VecDeque<T> {
/// # Examples
///
/// ```
/// #![feature(deque_extras)]
///
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
Expand All @@ -1793,9 +1787,7 @@ impl<T: Clone> VecDeque<T> {
/// assert_eq!(a, b);
/// }
/// ```
#[unstable(feature = "deque_extras",
reason = "matches collection reform specification; waiting on panic semantics",
issue = "27788")]
#[stable(feature = "deque_extras", since = "1.16.0")]
pub fn resize(&mut self, new_len: usize, value: T) {
let len = self.len();

Expand Down
Loading