Skip to content

Commit 7c2cd93

Browse files
committed
Stabilize library features for 1.18.0
Closes #38863 Closes #38980 Closes #38903 Closes #36648
1 parent d8215fc commit 7c2cd93

File tree

12 files changed

+27
-77
lines changed

12 files changed

+27
-77
lines changed

Diff for: src/doc/unstable-book/src/SUMMARY.md

-4
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@
104104
- [alloc](library-features/alloc.md)
105105
- [as_c_str](library-features/as-c-str.md)
106106
- [ascii_ctype](library-features/ascii-ctype.md)
107-
- [binary_heap_peek_mut_pop](library-features/binary-heap-peek-mut-pop.md)
108107
- [box_heap](library-features/box-heap.md)
109108
- [c_void_variant](library-features/c-void-variant.md)
110109
- [char_escape_debug](library-features/char-escape-debug.md)
@@ -175,17 +174,14 @@
175174
- [panic_abort](library-features/panic-abort.md)
176175
- [panic_unwind](library-features/panic-unwind.md)
177176
- [pattern](library-features/pattern.md)
178-
- [peek](library-features/peek.md)
179177
- [placement_in](library-features/placement-in.md)
180178
- [placement_new_protocol](library-features/placement-new-protocol.md)
181179
- [print_internals](library-features/print-internals.md)
182180
- [proc_macro_internals](library-features/proc-macro-internals.md)
183-
- [process_try_wait](library-features/process-try-wait.md)
184181
- [question_mark_carrier](library-features/question-mark-carrier.md)
185182
- [rand](library-features/rand.md)
186183
- [range_contains](library-features/range-contains.md)
187184
- [raw](library-features/raw.md)
188-
- [retain_hash_collection](library-features/retain-hash-collection.md)
189185
- [reverse_cmp_key](library-features/reverse-cmp-key.md)
190186
- [rt](library-features/rt.md)
191187
- [rustc_private](library-features/rustc-private.md)

Diff for: src/doc/unstable-book/src/library-features/binary-heap-peek-mut-pop.md

-7
This file was deleted.

Diff for: src/doc/unstable-book/src/library-features/peek.md

-7
This file was deleted.

Diff for: src/doc/unstable-book/src/library-features/process-try-wait.md

-7
This file was deleted.

Diff for: src/doc/unstable-book/src/library-features/retain-hash-collection.md

-7
This file was deleted.

Diff for: src/libcollections/binary_heap.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ impl<'a, T: Ord> DerefMut for PeekMut<'a, T> {
268268

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

Diff for: src/libcollections/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
#![deny(warnings)]
1212

13-
#![feature(binary_heap_peek_mut_pop)]
1413
#![feature(box_syntax)]
1514
#![feature(inclusive_range_syntax)]
1615
#![feature(collection_placement)]

Diff for: src/libstd/collections/hash/map.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1231,14 +1231,13 @@ impl<K, V, S> HashMap<K, V, S>
12311231
/// # Examples
12321232
///
12331233
/// ```
1234-
/// #![feature(retain_hash_collection)]
12351234
/// use std::collections::HashMap;
12361235
///
12371236
/// let mut map: HashMap<isize, isize> = (0..8).map(|x|(x, x*10)).collect();
12381237
/// map.retain(|&k, _| k % 2 == 0);
12391238
/// assert_eq!(map.len(), 4);
12401239
/// ```
1241-
#[unstable(feature = "retain_hash_collection", issue = "36648")]
1240+
#[stable(feature = "retain_hash_collection", since = "1.18.0")]
12421241
pub fn retain<F>(&mut self, mut f: F)
12431242
where F: FnMut(&K, &mut V) -> bool
12441243
{

Diff for: src/libstd/collections/hash/set.rs

+21-32
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ use super::map::{self, HashMap, Keys, RandomState};
116116
/// [`HashMap`]: struct.HashMap.html
117117
/// [`PartialEq`]: ../../std/cmp/trait.PartialEq.html
118118
/// [`RefCell`]: ../../std/cell/struct.RefCell.html
119-
120-
121119
#[derive(Clone)]
122120
#[stable(feature = "rust1", since = "1.0.0")]
123121
pub struct HashSet<T, S = RandomState> {
@@ -658,15 +656,14 @@ impl<T, S> HashSet<T, S>
658656
/// # Examples
659657
///
660658
/// ```
661-
/// #![feature(retain_hash_collection)]
662659
/// use std::collections::HashSet;
663660
///
664661
/// let xs = [1,2,3,4,5,6];
665662
/// let mut set: HashSet<isize> = xs.iter().cloned().collect();
666663
/// set.retain(|&k| k % 2 == 0);
667664
/// assert_eq!(set.len(), 3);
668665
/// ```
669-
#[unstable(feature = "retain_hash_collection", issue = "36648")]
666+
#[stable(feature = "retain_hash_collection", since = "1.18.0")]
670667
pub fn retain<F>(&mut self, mut f: F)
671668
where F: FnMut(&T) -> bool
672669
{
@@ -1041,9 +1038,7 @@ impl<'a, K> FusedIterator for Iter<'a, K> {}
10411038
#[stable(feature = "std_debug", since = "1.16.0")]
10421039
impl<'a, K: fmt::Debug> fmt::Debug for Iter<'a, K> {
10431040
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1044-
f.debug_list()
1045-
.entries(self.clone())
1046-
.finish()
1041+
f.debug_list().entries(self.clone()).finish()
10471042
}
10481043
}
10491044

@@ -1070,10 +1065,11 @@ impl<K> FusedIterator for IntoIter<K> {}
10701065
#[stable(feature = "std_debug", since = "1.16.0")]
10711066
impl<K: fmt::Debug> fmt::Debug for IntoIter<K> {
10721067
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1073-
let entries_iter = self.iter.inner.iter().map(|(k, _)| k);
1074-
f.debug_list()
1075-
.entries(entries_iter)
1076-
.finish()
1068+
let entries_iter = self.iter
1069+
.inner
1070+
.iter()
1071+
.map(|(k, _)| k);
1072+
f.debug_list().entries(entries_iter).finish()
10771073
}
10781074
}
10791075

@@ -1100,10 +1096,11 @@ impl<'a, K> FusedIterator for Drain<'a, K> {}
11001096
#[stable(feature = "std_debug", since = "1.16.0")]
11011097
impl<'a, K: fmt::Debug> fmt::Debug for Drain<'a, K> {
11021098
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1103-
let entries_iter = self.iter.inner.iter().map(|(k, _)| k);
1104-
f.debug_list()
1105-
.entries(entries_iter)
1106-
.finish()
1099+
let entries_iter = self.iter
1100+
.inner
1101+
.iter()
1102+
.map(|(k, _)| k);
1103+
f.debug_list().entries(entries_iter).finish()
11071104
}
11081105
}
11091106

@@ -1143,12 +1140,10 @@ impl<'a, T, S> Iterator for Intersection<'a, T, S>
11431140
#[stable(feature = "std_debug", since = "1.16.0")]
11441141
impl<'a, T, S> fmt::Debug for Intersection<'a, T, S>
11451142
where T: fmt::Debug + Eq + Hash,
1146-
S: BuildHasher,
1143+
S: BuildHasher
11471144
{
11481145
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1149-
f.debug_list()
1150-
.entries(self.clone())
1151-
.finish()
1146+
f.debug_list().entries(self.clone()).finish()
11521147
}
11531148
}
11541149

@@ -1202,12 +1197,10 @@ impl<'a, T, S> FusedIterator for Difference<'a, T, S>
12021197
#[stable(feature = "std_debug", since = "1.16.0")]
12031198
impl<'a, T, S> fmt::Debug for Difference<'a, T, S>
12041199
where T: fmt::Debug + Eq + Hash,
1205-
S: BuildHasher,
1200+
S: BuildHasher
12061201
{
12071202
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1208-
f.debug_list()
1209-
.entries(self.clone())
1210-
.finish()
1203+
f.debug_list().entries(self.clone()).finish()
12111204
}
12121205
}
12131206

@@ -1243,12 +1236,10 @@ impl<'a, T, S> FusedIterator for SymmetricDifference<'a, T, S>
12431236
#[stable(feature = "std_debug", since = "1.16.0")]
12441237
impl<'a, T, S> fmt::Debug for SymmetricDifference<'a, T, S>
12451238
where T: fmt::Debug + Eq + Hash,
1246-
S: BuildHasher,
1239+
S: BuildHasher
12471240
{
12481241
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1249-
f.debug_list()
1250-
.entries(self.clone())
1251-
.finish()
1242+
f.debug_list().entries(self.clone()).finish()
12521243
}
12531244
}
12541245

@@ -1269,12 +1260,10 @@ impl<'a, T, S> FusedIterator for Union<'a, T, S>
12691260
#[stable(feature = "std_debug", since = "1.16.0")]
12701261
impl<'a, T, S> fmt::Debug for Union<'a, T, S>
12711262
where T: fmt::Debug + Eq + Hash,
1272-
S: BuildHasher,
1263+
S: BuildHasher
12731264
{
12741265
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1275-
f.debug_list()
1276-
.entries(self.clone())
1277-
.finish()
1266+
f.debug_list().entries(self.clone()).finish()
12781267
}
12791268
}
12801269

@@ -1698,7 +1687,7 @@ mod test_set {
16981687

16991688
#[test]
17001689
fn test_retain() {
1701-
let xs = [1,2,3,4,5,6];
1690+
let xs = [1, 2, 3, 4, 5, 6];
17021691
let mut set: HashSet<isize> = xs.iter().cloned().collect();
17031692
set.retain(|&k| k % 2 == 0);
17041693
assert_eq!(set.len(), 3);

Diff for: src/libstd/net/tcp.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -343,15 +343,14 @@ impl TcpStream {
343343
/// # Examples
344344
///
345345
/// ```no_run
346-
/// #![feature(peek)]
347346
/// use std::net::TcpStream;
348347
///
349348
/// let stream = TcpStream::connect("127.0.0.1:8000")
350349
/// .expect("couldn't bind to address");
351350
/// let mut buf = [0; 10];
352351
/// let len = stream.peek(&mut buf).expect("peek failed");
353352
/// ```
354-
#[unstable(feature = "peek", issue = "38980")]
353+
#[stable(feature = "peek", since = "1.18.0")]
355354
pub fn peek(&self, buf: &mut [u8]) -> io::Result<usize> {
356355
self.0.peek(buf)
357356
}

Diff for: src/libstd/net/udp.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,14 @@ impl UdpSocket {
112112
/// # Examples
113113
///
114114
/// ```no_run
115-
/// #![feature(peek)]
116115
/// use std::net::UdpSocket;
117116
///
118117
/// let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
119118
/// let mut buf = [0; 10];
120119
/// let (number_of_bytes, src_addr) = socket.peek_from(&mut buf)
121120
/// .expect("Didn't receive data");
122121
/// ```
123-
#[unstable(feature = "peek", issue = "38980")]
122+
#[stable(feature = "peek", since = "1.18.0")]
124123
pub fn peek_from(&self, buf: &mut [u8]) -> io::Result<(usize, SocketAddr)> {
125124
self.0.peek_from(buf)
126125
}
@@ -638,7 +637,6 @@ impl UdpSocket {
638637
/// # Examples
639638
///
640639
/// ```no_run
641-
/// #![feature(peek)]
642640
/// use std::net::UdpSocket;
643641
///
644642
/// let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
@@ -649,7 +647,7 @@ impl UdpSocket {
649647
/// Err(e) => println!("peek function failed: {:?}", e),
650648
/// }
651649
/// ```
652-
#[unstable(feature = "peek", issue = "38980")]
650+
#[stable(feature = "peek", since = "1.18.0")]
653651
pub fn peek(&self, buf: &mut [u8]) -> io::Result<usize> {
654652
self.0.peek(buf)
655653
}

Diff for: src/libstd/process.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -905,8 +905,6 @@ impl Child {
905905
/// Basic usage:
906906
///
907907
/// ```no_run
908-
/// #![feature(process_try_wait)]
909-
///
910908
/// use std::process::Command;
911909
///
912910
/// let mut child = Command::new("ls").spawn().unwrap();
@@ -921,7 +919,7 @@ impl Child {
921919
/// Err(e) => println!("error attempting to wait: {}", e),
922920
/// }
923921
/// ```
924-
#[unstable(feature = "process_try_wait", issue = "38903")]
922+
#[stable(feature = "process_try_wait", since = "1.18.0")]
925923
pub fn try_wait(&mut self) -> io::Result<Option<ExitStatus>> {
926924
Ok(self.handle.try_wait()?.map(ExitStatus))
927925
}

0 commit comments

Comments
 (0)