1
Fork 0

Stabilize library features for 1.18.0

Closes #38863
Closes #38980
Closes #38903
Closes #36648
This commit is contained in:
Steven Fackler 2017-05-10 21:17:24 -07:00
parent d8215fc238
commit 7c2cd93b2b
12 changed files with 27 additions and 77 deletions

View file

@ -104,7 +104,6 @@
- [alloc](library-features/alloc.md) - [alloc](library-features/alloc.md)
- [as_c_str](library-features/as-c-str.md) - [as_c_str](library-features/as-c-str.md)
- [ascii_ctype](library-features/ascii-ctype.md) - [ascii_ctype](library-features/ascii-ctype.md)
- [binary_heap_peek_mut_pop](library-features/binary-heap-peek-mut-pop.md)
- [box_heap](library-features/box-heap.md) - [box_heap](library-features/box-heap.md)
- [c_void_variant](library-features/c-void-variant.md) - [c_void_variant](library-features/c-void-variant.md)
- [char_escape_debug](library-features/char-escape-debug.md) - [char_escape_debug](library-features/char-escape-debug.md)
@ -175,17 +174,14 @@
- [panic_abort](library-features/panic-abort.md) - [panic_abort](library-features/panic-abort.md)
- [panic_unwind](library-features/panic-unwind.md) - [panic_unwind](library-features/panic-unwind.md)
- [pattern](library-features/pattern.md) - [pattern](library-features/pattern.md)
- [peek](library-features/peek.md)
- [placement_in](library-features/placement-in.md) - [placement_in](library-features/placement-in.md)
- [placement_new_protocol](library-features/placement-new-protocol.md) - [placement_new_protocol](library-features/placement-new-protocol.md)
- [print_internals](library-features/print-internals.md) - [print_internals](library-features/print-internals.md)
- [proc_macro_internals](library-features/proc-macro-internals.md) - [proc_macro_internals](library-features/proc-macro-internals.md)
- [process_try_wait](library-features/process-try-wait.md)
- [question_mark_carrier](library-features/question-mark-carrier.md) - [question_mark_carrier](library-features/question-mark-carrier.md)
- [rand](library-features/rand.md) - [rand](library-features/rand.md)
- [range_contains](library-features/range-contains.md) - [range_contains](library-features/range-contains.md)
- [raw](library-features/raw.md) - [raw](library-features/raw.md)
- [retain_hash_collection](library-features/retain-hash-collection.md)
- [reverse_cmp_key](library-features/reverse-cmp-key.md) - [reverse_cmp_key](library-features/reverse-cmp-key.md)
- [rt](library-features/rt.md) - [rt](library-features/rt.md)
- [rustc_private](library-features/rustc-private.md) - [rustc_private](library-features/rustc-private.md)

View file

@ -1,7 +0,0 @@
# `binary_heap_peek_mut_pop`
The tracking issue for this feature is: [#38863]
[#38863]: https://github.com/rust-lang/rust/issues/38863
------------------------

View file

@ -1,7 +0,0 @@
# `peek`
The tracking issue for this feature is: [#38980]
[#38980]: https://github.com/rust-lang/rust/issues/38980
------------------------

View file

@ -1,7 +0,0 @@
# `process_try_wait`
The tracking issue for this feature is: [#38903]
[#38903]: https://github.com/rust-lang/rust/issues/38903
------------------------

View file

@ -1,7 +0,0 @@
# `retain_hash_collection`
The tracking issue for this feature is: [#36648]
[#36648]: https://github.com/rust-lang/rust/issues/36648
------------------------

View file

@ -268,7 +268,7 @@ impl<'a, T: Ord> DerefMut for PeekMut<'a, T> {
impl<'a, T: Ord> PeekMut<'a, T> { impl<'a, T: Ord> PeekMut<'a, T> {
/// Removes the peeked value from the heap and returns it. /// Removes the peeked value from the heap and returns it.
#[unstable(feature = "binary_heap_peek_mut_pop", issue = "38863")] #[stable(feature = "binary_heap_peek_mut_pop", since = "1.18.0")]
pub fn pop(mut this: PeekMut<'a, T>) -> T { pub fn pop(mut this: PeekMut<'a, T>) -> T {
let value = this.heap.pop().unwrap(); let value = this.heap.pop().unwrap();
this.sift = false; this.sift = false;

View file

@ -10,7 +10,6 @@
#![deny(warnings)] #![deny(warnings)]
#![feature(binary_heap_peek_mut_pop)]
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(inclusive_range_syntax)] #![feature(inclusive_range_syntax)]
#![feature(collection_placement)] #![feature(collection_placement)]

View file

@ -1231,14 +1231,13 @@ impl<K, V, S> HashMap<K, V, S>
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(retain_hash_collection)]
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// let mut map: HashMap<isize, isize> = (0..8).map(|x|(x, x*10)).collect(); /// let mut map: HashMap<isize, isize> = (0..8).map(|x|(x, x*10)).collect();
/// map.retain(|&k, _| k % 2 == 0); /// map.retain(|&k, _| k % 2 == 0);
/// assert_eq!(map.len(), 4); /// assert_eq!(map.len(), 4);
/// ``` /// ```
#[unstable(feature = "retain_hash_collection", issue = "36648")] #[stable(feature = "retain_hash_collection", since = "1.18.0")]
pub fn retain<F>(&mut self, mut f: F) pub fn retain<F>(&mut self, mut f: F)
where F: FnMut(&K, &mut V) -> bool where F: FnMut(&K, &mut V) -> bool
{ {

View file

@ -116,8 +116,6 @@ use super::map::{self, HashMap, Keys, RandomState};
/// [`HashMap`]: struct.HashMap.html /// [`HashMap`]: struct.HashMap.html
/// [`PartialEq`]: ../../std/cmp/trait.PartialEq.html /// [`PartialEq`]: ../../std/cmp/trait.PartialEq.html
/// [`RefCell`]: ../../std/cell/struct.RefCell.html /// [`RefCell`]: ../../std/cell/struct.RefCell.html
#[derive(Clone)] #[derive(Clone)]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub struct HashSet<T, S = RandomState> { pub struct HashSet<T, S = RandomState> {
@ -658,7 +656,6 @@ impl<T, S> HashSet<T, S>
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(retain_hash_collection)]
/// use std::collections::HashSet; /// use std::collections::HashSet;
/// ///
/// let xs = [1,2,3,4,5,6]; /// let xs = [1,2,3,4,5,6];
@ -666,7 +663,7 @@ impl<T, S> HashSet<T, S>
/// set.retain(|&k| k % 2 == 0); /// set.retain(|&k| k % 2 == 0);
/// assert_eq!(set.len(), 3); /// assert_eq!(set.len(), 3);
/// ``` /// ```
#[unstable(feature = "retain_hash_collection", issue = "36648")] #[stable(feature = "retain_hash_collection", since = "1.18.0")]
pub fn retain<F>(&mut self, mut f: F) pub fn retain<F>(&mut self, mut f: F)
where F: FnMut(&T) -> bool where F: FnMut(&T) -> bool
{ {
@ -1041,9 +1038,7 @@ impl<'a, K> FusedIterator for Iter<'a, K> {}
#[stable(feature = "std_debug", since = "1.16.0")] #[stable(feature = "std_debug", since = "1.16.0")]
impl<'a, K: fmt::Debug> fmt::Debug for Iter<'a, K> { impl<'a, K: fmt::Debug> fmt::Debug for Iter<'a, K> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_list() f.debug_list().entries(self.clone()).finish()
.entries(self.clone())
.finish()
} }
} }
@ -1070,10 +1065,11 @@ impl<K> FusedIterator for IntoIter<K> {}
#[stable(feature = "std_debug", since = "1.16.0")] #[stable(feature = "std_debug", since = "1.16.0")]
impl<K: fmt::Debug> fmt::Debug for IntoIter<K> { impl<K: fmt::Debug> fmt::Debug for IntoIter<K> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let entries_iter = self.iter.inner.iter().map(|(k, _)| k); let entries_iter = self.iter
f.debug_list() .inner
.entries(entries_iter) .iter()
.finish() .map(|(k, _)| k);
f.debug_list().entries(entries_iter).finish()
} }
} }
@ -1100,10 +1096,11 @@ impl<'a, K> FusedIterator for Drain<'a, K> {}
#[stable(feature = "std_debug", since = "1.16.0")] #[stable(feature = "std_debug", since = "1.16.0")]
impl<'a, K: fmt::Debug> fmt::Debug for Drain<'a, K> { impl<'a, K: fmt::Debug> fmt::Debug for Drain<'a, K> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let entries_iter = self.iter.inner.iter().map(|(k, _)| k); let entries_iter = self.iter
f.debug_list() .inner
.entries(entries_iter) .iter()
.finish() .map(|(k, _)| k);
f.debug_list().entries(entries_iter).finish()
} }
} }
@ -1143,12 +1140,10 @@ impl<'a, T, S> Iterator for Intersection<'a, T, S>
#[stable(feature = "std_debug", since = "1.16.0")] #[stable(feature = "std_debug", since = "1.16.0")]
impl<'a, T, S> fmt::Debug for Intersection<'a, T, S> impl<'a, T, S> fmt::Debug for Intersection<'a, T, S>
where T: fmt::Debug + Eq + Hash, where T: fmt::Debug + Eq + Hash,
S: BuildHasher, S: BuildHasher
{ {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_list() f.debug_list().entries(self.clone()).finish()
.entries(self.clone())
.finish()
} }
} }
@ -1202,12 +1197,10 @@ impl<'a, T, S> FusedIterator for Difference<'a, T, S>
#[stable(feature = "std_debug", since = "1.16.0")] #[stable(feature = "std_debug", since = "1.16.0")]
impl<'a, T, S> fmt::Debug for Difference<'a, T, S> impl<'a, T, S> fmt::Debug for Difference<'a, T, S>
where T: fmt::Debug + Eq + Hash, where T: fmt::Debug + Eq + Hash,
S: BuildHasher, S: BuildHasher
{ {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_list() f.debug_list().entries(self.clone()).finish()
.entries(self.clone())
.finish()
} }
} }
@ -1243,12 +1236,10 @@ impl<'a, T, S> FusedIterator for SymmetricDifference<'a, T, S>
#[stable(feature = "std_debug", since = "1.16.0")] #[stable(feature = "std_debug", since = "1.16.0")]
impl<'a, T, S> fmt::Debug for SymmetricDifference<'a, T, S> impl<'a, T, S> fmt::Debug for SymmetricDifference<'a, T, S>
where T: fmt::Debug + Eq + Hash, where T: fmt::Debug + Eq + Hash,
S: BuildHasher, S: BuildHasher
{ {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_list() f.debug_list().entries(self.clone()).finish()
.entries(self.clone())
.finish()
} }
} }
@ -1269,12 +1260,10 @@ impl<'a, T, S> FusedIterator for Union<'a, T, S>
#[stable(feature = "std_debug", since = "1.16.0")] #[stable(feature = "std_debug", since = "1.16.0")]
impl<'a, T, S> fmt::Debug for Union<'a, T, S> impl<'a, T, S> fmt::Debug for Union<'a, T, S>
where T: fmt::Debug + Eq + Hash, where T: fmt::Debug + Eq + Hash,
S: BuildHasher, S: BuildHasher
{ {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_list() f.debug_list().entries(self.clone()).finish()
.entries(self.clone())
.finish()
} }
} }
@ -1698,7 +1687,7 @@ mod test_set {
#[test] #[test]
fn test_retain() { fn test_retain() {
let xs = [1,2,3,4,5,6]; let xs = [1, 2, 3, 4, 5, 6];
let mut set: HashSet<isize> = xs.iter().cloned().collect(); let mut set: HashSet<isize> = xs.iter().cloned().collect();
set.retain(|&k| k % 2 == 0); set.retain(|&k| k % 2 == 0);
assert_eq!(set.len(), 3); assert_eq!(set.len(), 3);

View file

@ -343,7 +343,6 @@ impl TcpStream {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// #![feature(peek)]
/// use std::net::TcpStream; /// use std::net::TcpStream;
/// ///
/// let stream = TcpStream::connect("127.0.0.1:8000") /// let stream = TcpStream::connect("127.0.0.1:8000")
@ -351,7 +350,7 @@ impl TcpStream {
/// let mut buf = [0; 10]; /// let mut buf = [0; 10];
/// let len = stream.peek(&mut buf).expect("peek failed"); /// let len = stream.peek(&mut buf).expect("peek failed");
/// ``` /// ```
#[unstable(feature = "peek", issue = "38980")] #[stable(feature = "peek", since = "1.18.0")]
pub fn peek(&self, buf: &mut [u8]) -> io::Result<usize> { pub fn peek(&self, buf: &mut [u8]) -> io::Result<usize> {
self.0.peek(buf) self.0.peek(buf)
} }

View file

@ -112,7 +112,6 @@ impl UdpSocket {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// #![feature(peek)]
/// use std::net::UdpSocket; /// use std::net::UdpSocket;
/// ///
/// let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address"); /// let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
@ -120,7 +119,7 @@ impl UdpSocket {
/// let (number_of_bytes, src_addr) = socket.peek_from(&mut buf) /// let (number_of_bytes, src_addr) = socket.peek_from(&mut buf)
/// .expect("Didn't receive data"); /// .expect("Didn't receive data");
/// ``` /// ```
#[unstable(feature = "peek", issue = "38980")] #[stable(feature = "peek", since = "1.18.0")]
pub fn peek_from(&self, buf: &mut [u8]) -> io::Result<(usize, SocketAddr)> { pub fn peek_from(&self, buf: &mut [u8]) -> io::Result<(usize, SocketAddr)> {
self.0.peek_from(buf) self.0.peek_from(buf)
} }
@ -638,7 +637,6 @@ impl UdpSocket {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// #![feature(peek)]
/// use std::net::UdpSocket; /// use std::net::UdpSocket;
/// ///
/// let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address"); /// let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
@ -649,7 +647,7 @@ impl UdpSocket {
/// Err(e) => println!("peek function failed: {:?}", e), /// Err(e) => println!("peek function failed: {:?}", e),
/// } /// }
/// ``` /// ```
#[unstable(feature = "peek", issue = "38980")] #[stable(feature = "peek", since = "1.18.0")]
pub fn peek(&self, buf: &mut [u8]) -> io::Result<usize> { pub fn peek(&self, buf: &mut [u8]) -> io::Result<usize> {
self.0.peek(buf) self.0.peek(buf)
} }

View file

@ -905,8 +905,6 @@ impl Child {
/// Basic usage: /// Basic usage:
/// ///
/// ```no_run /// ```no_run
/// #![feature(process_try_wait)]
///
/// use std::process::Command; /// use std::process::Command;
/// ///
/// let mut child = Command::new("ls").spawn().unwrap(); /// let mut child = Command::new("ls").spawn().unwrap();
@ -921,7 +919,7 @@ impl Child {
/// Err(e) => println!("error attempting to wait: {}", e), /// Err(e) => println!("error attempting to wait: {}", e),
/// } /// }
/// ``` /// ```
#[unstable(feature = "process_try_wait", issue = "38903")] #[stable(feature = "process_try_wait", since = "1.18.0")]
pub fn try_wait(&mut self) -> io::Result<Option<ExitStatus>> { pub fn try_wait(&mut self) -> io::Result<Option<ExitStatus>> {
Ok(self.handle.try_wait()?.map(ExitStatus)) Ok(self.handle.try_wait()?.map(ExitStatus))
} }