Skip to content

Commit 139d12f

Browse files
committed
Auto merge of #42161 - brson:beta-next, r=alexcrichton
[beta] backports - #42006 - #41904 Bumps the version so we get a new beta. @sfackler libs backports here @nikomatsakis there are several other nominated PRs that don't cherry-pick cleanly: https://github.com/rust-lang/rust/pulls?q=is%3Apr+label%3Abeta-nominated+is%3Aclosed. Can you take a look or recruit someone else to? r? @alexcrichton
2 parents 191cde0 + 61063b0 commit 139d12f

File tree

16 files changed

+46
-83
lines changed

16 files changed

+46
-83
lines changed

src/bootstrap/channel.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub const CFG_RELEASE_NUM: &'static str = "1.18.0";
2828
// An optional number to put after the label, e.g. '.2' -> '-beta.2'
2929
// Be sure to make this starts with a dot to conform to semver pre-release
3030
// versions (section 9)
31-
pub const CFG_PRERELEASE_VERSION: &'static str = ".2";
31+
pub const CFG_PRERELEASE_VERSION: &'static str = ".3";
3232

3333
pub struct GitInfo {
3434
inner: Option<Info>,

src/doc/unstable-book/src/SUMMARY.md

-4
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@
103103
- [alloc](library-features/alloc.md)
104104
- [as_c_str](library-features/as-c-str.md)
105105
- [ascii_ctype](library-features/ascii-ctype.md)
106-
- [binary_heap_peek_mut_pop](library-features/binary-heap-peek-mut-pop.md)
107106
- [box_heap](library-features/box-heap.md)
108107
- [c_void_variant](library-features/c-void-variant.md)
109108
- [char_escape_debug](library-features/char-escape-debug.md)
@@ -172,17 +171,14 @@
172171
- [panic_abort](library-features/panic-abort.md)
173172
- [panic_unwind](library-features/panic-unwind.md)
174173
- [pattern](library-features/pattern.md)
175-
- [peek](library-features/peek.md)
176174
- [placement_in](library-features/placement-in.md)
177175
- [placement_new_protocol](library-features/placement-new-protocol.md)
178176
- [print](library-features/print.md)
179177
- [proc_macro_internals](library-features/proc-macro-internals.md)
180-
- [process_try_wait](library-features/process-try-wait.md)
181178
- [question_mark_carrier](library-features/question-mark-carrier.md)
182179
- [rand](library-features/rand.md)
183180
- [range_contains](library-features/range-contains.md)
184181
- [raw](library-features/raw.md)
185-
- [retain_hash_collection](library-features/retain-hash-collection.md)
186182
- [reverse_cmp_key](library-features/reverse-cmp-key.md)
187183
- [rt](library-features/rt.md)
188184
- [rustc_private](library-features/rustc-private.md)

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

-7
This file was deleted.

src/doc/unstable-book/src/library-features/peek.md

-7
This file was deleted.

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

-7
This file was deleted.

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

-7
This file was deleted.

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;

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)]

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
{

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);

src/libstd/net/tcp.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -337,15 +337,14 @@ impl TcpStream {
337337
/// # Examples
338338
///
339339
/// ```no_run
340-
/// #![feature(peek)]
341340
/// use std::net::TcpStream;
342341
///
343342
/// let stream = TcpStream::connect("127.0.0.1:8000")
344343
/// .expect("couldn't bind to address");
345344
/// let mut buf = [0; 10];
346345
/// let len = stream.peek(&mut buf).expect("peek failed");
347346
/// ```
348-
#[unstable(feature = "peek", issue = "38980")]
347+
#[stable(feature = "peek", since = "1.18.0")]
349348
pub fn peek(&self, buf: &mut [u8]) -> io::Result<usize> {
350349
self.0.peek(buf)
351350
}

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
}

src/libstd/process.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -903,8 +903,6 @@ impl Child {
903903
/// Basic usage:
904904
///
905905
/// ```no_run
906-
/// #![feature(process_try_wait)]
907-
///
908906
/// use std::process::Command;
909907
///
910908
/// let mut child = Command::new("ls").spawn().unwrap();
@@ -919,7 +917,7 @@ impl Child {
919917
/// Err(e) => println!("error attempting to wait: {}", e),
920918
/// }
921919
/// ```
922-
#[unstable(feature = "process_try_wait", issue = "38903")]
920+
#[stable(feature = "process_try_wait", since = "1.18.0")]
923921
pub fn try_wait(&mut self) -> io::Result<Option<ExitStatus>> {
924922
Ok(self.handle.try_wait()?.map(ExitStatus))
925923
}

src/libsyntax/ext/base.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ impl<'a> ExtCtxt<'a> {
695695
/// Returns span for the macro which originally caused the current expansion to happen.
696696
///
697697
/// Stops backtracing at include! boundary.
698-
pub fn expansion_cause(&self) -> Span {
698+
pub fn expansion_cause(&self) -> Option<Span> {
699699
let mut ctxt = self.backtrace();
700700
let mut last_macro = None;
701701
loop {
@@ -711,7 +711,7 @@ impl<'a> ExtCtxt<'a> {
711711
break
712712
}
713713
}
714-
last_macro.expect("missing expansion backtrace")
714+
last_macro
715715
}
716716

717717
pub fn struct_span_warn(&self,

src/libsyntax/ext/source_util.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub fn expand_line(cx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::TokenTree])
3535
-> Box<base::MacResult+'static> {
3636
base::check_zero_tts(cx, sp, tts, "line!");
3737

38-
let topmost = cx.expansion_cause();
38+
let topmost = cx.expansion_cause().unwrap_or(sp);
3939
let loc = cx.codemap().lookup_char_pos(topmost.lo);
4040

4141
base::MacEager::expr(cx.expr_u32(topmost, loc.line as u32))
@@ -46,7 +46,7 @@ pub fn expand_column(cx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::TokenTree])
4646
-> Box<base::MacResult+'static> {
4747
base::check_zero_tts(cx, sp, tts, "column!");
4848

49-
let topmost = cx.expansion_cause();
49+
let topmost = cx.expansion_cause().unwrap_or(sp);
5050
let loc = cx.codemap().lookup_char_pos(topmost.lo);
5151

5252
base::MacEager::expr(cx.expr_u32(topmost, loc.col.to_usize() as u32))
@@ -59,7 +59,7 @@ pub fn expand_file(cx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::TokenTree])
5959
-> Box<base::MacResult+'static> {
6060
base::check_zero_tts(cx, sp, tts, "file!");
6161

62-
let topmost = cx.expansion_cause();
62+
let topmost = cx.expansion_cause().unwrap_or(sp);
6363
let loc = cx.codemap().lookup_char_pos(topmost.lo);
6464
base::MacEager::expr(cx.expr_str(topmost, Symbol::intern(&loc.file.name)))
6565
}

src/test/compile-fail/issue-41776.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn main() {
12+
include!(line!()); //~ ERROR argument must be a string literal
13+
}

0 commit comments

Comments
 (0)