Skip to content

Commit 2174bd9

Browse files
committed
Auto merge of #32960 - steveklabnik:rollup, r=steveklabnik
Rollup of 15 pull requests - Successful merges: #32646, #32855, #32856, #32865, #32868, #32869, #32876, #32884, #32885, #32893, #32894, #32932, #32937, #32940, #32941 - Failed merges: #32912
2 parents 2b5d24a + 7e2302b commit 2174bd9

File tree

23 files changed

+77
-30
lines changed

23 files changed

+77
-30
lines changed

RELEASES.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ Compatibility Notes
418418
numbers [no longer return platform-specific types][1.8r], but
419419
instead return widened integers. [RFC 1415].
420420
* [Modules sourced from the filesystem cannot appear within arbitrary
421-
blocks, but only within other modules][1.8m].
421+
blocks, but only within other modules][1.8mf].
422422
* [`--cfg` compiler flags are parsed strictly as identifiers][1.8c].
423423
* On Unix, [stack overflow triggers a runtime abort instead of a
424424
SIGSEGV][1.8so].
@@ -448,7 +448,7 @@ Compatibility Notes
448448
[1.8h]: https://github.com/rust-lang/rust/pull/31460
449449
[1.8l]: https://github.com/rust-lang/rust/pull/31668
450450
[1.8m]: https://github.com/rust-lang/rust/pull/31020
451-
[1.8m]: https://github.com/rust-lang/rust/pull/31534
451+
[1.8mf]: https://github.com/rust-lang/rust/pull/31534
452452
[1.8mp]: https://github.com/rust-lang/rust/pull/30894
453453
[1.8mr]: https://users.rust-lang.org/t/multirust-0-8-with-cross-std-installation/4901
454454
[1.8ms]: https://github.com/rust-lang/rust/pull/30448

mk/main.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
######################################################################
1414

1515
# The version number
16-
CFG_RELEASE_NUM=1.9.0
16+
CFG_RELEASE_NUM=1.10.0
1717

1818
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
1919
# NB Make sure it starts with a dot to conform to semver pre-release

src/bootstrap/Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bootstrap/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ path = "rustdoc.rs"
2121

2222
[dependencies]
2323
build_helper = { path = "../build_helper" }
24-
cmake = "0.1.10"
24+
cmake = "0.1.17"
2525
filetime = "0.1"
2626
num_cpus = "0.2"
2727
toml = "0.1"

src/bootstrap/build/config.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ use toml::{Parser, Decoder, Value};
3131
#[derive(Default)]
3232
pub struct Config {
3333
pub ccache: bool,
34+
pub ninja: bool,
3435
pub verbose: bool,
3536
pub submodules: bool,
3637
pub compiler_docs: bool,
@@ -107,6 +108,7 @@ struct Build {
107108
#[derive(RustcDecodable, Default)]
108109
struct Llvm {
109110
ccache: Option<bool>,
111+
ninja: Option<bool>,
110112
assertions: Option<bool>,
111113
optimize: Option<bool>,
112114
version_check: Option<bool>,
@@ -200,9 +202,9 @@ impl Config {
200202

201203
if let Some(ref llvm) = toml.llvm {
202204
set(&mut config.ccache, llvm.ccache);
205+
set(&mut config.ninja, llvm.ninja);
203206
set(&mut config.llvm_assertions, llvm.assertions);
204207
set(&mut config.llvm_optimize, llvm.optimize);
205-
set(&mut config.llvm_optimize, llvm.optimize);
206208
set(&mut config.llvm_version_check, llvm.version_check);
207209
set(&mut config.llvm_static_stdcpp, llvm.static_libstdcpp);
208210
}

src/bootstrap/build/native.rs

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ pub fn llvm(build: &Build, target: &str) {
4343

4444
// http://llvm.org/docs/CMake.html
4545
let mut cfg = cmake::Config::new(build.src.join("src/llvm"));
46+
if build.config.ninja {
47+
cfg.generator("Ninja");
48+
}
4649
cfg.target(target)
4750
.host(&build.config.build)
4851
.out_dir(&dst)

src/bootstrap/build/sanity.rs

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ pub fn check(build: &mut Build) {
4848
}
4949
}
5050
need_cmd("cmake".as_ref());
51+
if build.config.ninja {
52+
need_cmd("ninja".as_ref())
53+
}
5154
break
5255
}
5356

src/doc/book/guessing-game.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -988,8 +988,7 @@ fn main() {
988988
989989
# Complete!
990990
991-
At this point, you have successfully built the Guessing Game! Congratulations!
991+
This project showed you a lot: `let`, `match`, methods, associated
992+
functions, using external crates, and more.
992993
993-
This first project showed you a lot: `let`, `match`, methods, associated
994-
functions, using external crates, and more. Our next project will show off
995-
even more.
994+
At this point, you have successfully built the Guessing Game! Congratulations!

src/libcollections/str.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -634,9 +634,9 @@ impl str {
634634
/// Basic usage:
635635
///
636636
/// ```
637-
/// let s = "Per Martin-Löf";
637+
/// let mut s = "Per Martin-Löf".to_string();
638638
///
639-
/// let (first, last) = s.split_at(3);
639+
/// let (first, last) = s.split_at_mut(3);
640640
///
641641
/// assert_eq!("Per", first);
642642
/// assert_eq!(" Martin-Löf", last);

src/libcollectionstest/str.rs

+16
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,22 @@ fn test_slice_fail() {
346346
&"中华Việt Nam"[0..2];
347347
}
348348

349+
350+
#[test]
351+
fn test_is_char_boundary() {
352+
let s = "ศไทย中华Việt Nam β-release 🐱123";
353+
assert!(s.is_char_boundary(0));
354+
assert!(s.is_char_boundary(s.len()));
355+
assert!(!s.is_char_boundary(s.len() + 1));
356+
for (i, ch) in s.char_indices() {
357+
// ensure character locations are boundaries and continuation bytes are not
358+
assert!(s.is_char_boundary(i), "{} is a char boundary in {:?}", i, s);
359+
for j in 1..ch.len_utf8() {
360+
assert!(!s.is_char_boundary(i + j),
361+
"{} should not be a char boundary in {:?}", i + j, s);
362+
}
363+
}
364+
}
349365
const LOREM_PARAGRAPH: &'static str = "\
350366
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse quis lorem sit amet dolor \
351367
ultricies condimentum. Praesent iaculis purus elit, ac malesuada quam malesuada in. Duis sed orci \

src/libcore/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ macro_rules! debug_assert_eq {
182182
/// fn write_to_file_using_match() -> Result<(), io::Error> {
183183
/// let mut file = try!(File::create("my_best_friends.txt"));
184184
/// match file.write_all(b"This is a list of my best friends.") {
185-
/// Ok(_) => (),
185+
/// Ok(v) => v,
186186
/// Err(e) => return Err(e),
187187
/// }
188188
/// println!("I wrote to the file");

src/librustc/session/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
892892
opt::multi_s("L", "", "Add a directory to the library search path",
893893
"[KIND=]PATH"),
894894
opt::multi_s("l", "", "Link the generated crate(s) to the specified native
895-
library NAME. The optional KIND can be one of,
895+
library NAME. The optional KIND can be one of
896896
static, dylib, or framework. If omitted, dylib is
897897
assumed.", "[KIND=]NAME"),
898898
opt::multi_s("", "crate-type", "Comma separated list of types of crates

src/librustc_back/target/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
//! rustc will search each directory in the environment variable
2828
//! `RUST_TARGET_PATH` for a file named `TRIPLE.json`. The first one found will
2929
//! be loaded. If no file is found in any of those directories, a fatal error
30-
//! will be given. `RUST_TARGET_PATH` includes `/etc/rustc` as its last entry,
31-
//! to be searched by default.
30+
//! will be given.
3231
//!
3332
//! Projects defining their own targets should use
3433
//! `--target=path/to/my-awesome-platform.json` instead of adding to

src/librustc_const_eval/check_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
pub use self::Constructor::*;
11+
use self::Constructor::*;
1212
use self::Usefulness::*;
1313
use self::WitnessPreference::*;
1414

src/librustc_mir/build/matches/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ impl<'a,'tcx> Builder<'a,'tcx> {
434434
/// But there may also be candidates that the test just doesn't
435435
/// apply to. For example, consider the case of #29740:
436436
///
437-
/// ```rust
437+
/// ```rust,ignore
438438
/// match x {
439439
/// "foo" => ...,
440440
/// "bar" => ...,

src/librustc_mir/build/matches/util.rs

+4
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,18 @@ impl<'a,'tcx> Builder<'a,'tcx> {
3232
/// this function converts the prefix (`x`, `y`) and suffix (`z`) into
3333
/// distinct match pairs:
3434
///
35+
/// ```rust,ignore
3536
/// lv[0 of 3] @ x // see ProjectionElem::ConstantIndex (and its Debug impl)
3637
/// lv[1 of 3] @ y // to explain the `[x of y]` notation
3738
/// lv[-1 of 3] @ z
39+
/// ```
3840
///
3941
/// If a slice like `s` is present, then the function also creates
4042
/// a temporary like:
4143
///
44+
/// ```rust,ignore
4245
/// tmp0 = lv[2..-1] // using the special Rvalue::Slice
46+
/// ```
4347
///
4448
/// and creates a match pair `tmp0 @ s`
4549
pub fn prefix_suffix_slice<'pat>(&mut self,

src/librustc_mir/build/scope.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ set of scheduled drops up front, and so whenever we exit from the
4747
scope we only drop the values scheduled thus far. For example, consider
4848
the scope S corresponding to this loop:
4949
50-
```
50+
```rust,ignore
5151
loop {
5252
let x = ...;
5353
if cond { break; }

src/librustc_mir/pretty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const INDENT: &'static str = " ";
2323
/// If the session is properly configured, dumps a human-readable
2424
/// representation of the mir into:
2525
///
26-
/// ```
26+
/// ```text
2727
/// rustc.node<node_id>.<pass_name>.<disambiguator>
2828
/// ```
2929
///

src/librustc_mir/traversal.rs

+10
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@ use rustc::mir::repr::*;
1919
/// Preorder traversal is when each node is visited before an of it's
2020
/// successors
2121
///
22+
/// ```text
23+
///
2224
/// A
2325
/// / \
2426
/// / \
2527
/// B C
2628
/// \ /
2729
/// \ /
2830
/// D
31+
/// ```
2932
///
3033
/// A preorder traversal of this graph is either `A B D C` or `A C D B`
3134
#[derive(Clone)]
@@ -80,13 +83,17 @@ impl<'a, 'tcx> Iterator for Preorder<'a, 'tcx> {
8083
/// Postorder traversal is when each node is visited after all of it's
8184
/// successors, except when the successor is only reachable by a back-edge
8285
///
86+
///
87+
/// ```text
88+
///
8389
/// A
8490
/// / \
8591
/// / \
8692
/// B C
8793
/// \ /
8894
/// \ /
8995
/// D
96+
/// ```
9097
///
9198
/// A Postorder traversal of this graph is `D B C A` or `D C B A`
9299
pub struct Postorder<'a, 'tcx: 'a> {
@@ -215,13 +222,16 @@ impl<'a, 'tcx> Iterator for Postorder<'a, 'tcx> {
215222
/// This is different to a preorder traversal and represents a natural
216223
/// linearisation of control-flow.
217224
///
225+
/// ```text
226+
///
218227
/// A
219228
/// / \
220229
/// / \
221230
/// B C
222231
/// \ /
223232
/// \ /
224233
/// D
234+
/// ```
225235
///
226236
/// A reverse postorder traversal of this graph is either `A B C D` or `A C B D`
227237
/// Note that for a graph containing no loops (i.e. A DAG), this is equivalent to

src/librustc_trans/_match.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ use self::Opt::*;
189189
use self::FailureHandler::*;
190190

191191
use llvm::{ValueRef, BasicBlockRef};
192-
use rustc_const_eval::check_match::{self, StaticInliner};
192+
use rustc_const_eval::check_match::{self, Constructor, StaticInliner};
193193
use rustc_const_eval::{compare_lit_exprs, eval_const_expr};
194194
use rustc::hir::def::{Def, DefMap};
195195
use rustc::hir::def_id::DefId;
@@ -609,19 +609,19 @@ fn enter_opt<'a, 'p, 'blk, 'tcx>(
609609
let _indenter = indenter();
610610

611611
let ctor = match opt {
612-
&ConstantValue(ConstantExpr(expr), _) => check_match::ConstantValue(
612+
&ConstantValue(ConstantExpr(expr), _) => Constructor::ConstantValue(
613613
eval_const_expr(bcx.tcx(), &expr)
614614
),
615-
&ConstantRange(ConstantExpr(lo), ConstantExpr(hi), _) => check_match::ConstantRange(
615+
&ConstantRange(ConstantExpr(lo), ConstantExpr(hi), _) => Constructor::ConstantRange(
616616
eval_const_expr(bcx.tcx(), &lo),
617617
eval_const_expr(bcx.tcx(), &hi)
618618
),
619619
&SliceLengthEqual(n, _) =>
620-
check_match::Slice(n),
620+
Constructor::Slice(n),
621621
&SliceLengthGreaterOrEqual(before, after, _) =>
622-
check_match::SliceWithSubslice(before, after),
622+
Constructor::SliceWithSubslice(before, after),
623623
&Variant(_, _, def_id, _) =>
624-
check_match::Constructor::Variant(def_id)
624+
Constructor::Variant(def_id)
625625
};
626626

627627
let param_env = bcx.tcx().empty_parameter_environment();
@@ -1229,7 +1229,7 @@ fn compile_submatch_continue<'a, 'p, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
12291229
Some(field_vals) => {
12301230
let pats = enter_match(bcx, dm, m, col, val, |pats|
12311231
check_match::specialize(&mcx, pats,
1232-
&check_match::Single, col,
1232+
&Constructor::Single, col,
12331233
field_vals.len())
12341234
);
12351235
let mut vals: Vec<_> = field_vals.into_iter()

src/libstd/io/mod.rs

+12
Original file line numberDiff line numberDiff line change
@@ -1505,6 +1505,11 @@ impl<T: Read> Read for Take<T> {
15051505
#[stable(feature = "rust1", since = "1.0.0")]
15061506
impl<T: BufRead> BufRead for Take<T> {
15071507
fn fill_buf(&mut self) -> Result<&[u8]> {
1508+
// Don't call into inner reader at all at EOF because it may still block
1509+
if self.limit == 0 {
1510+
return Ok(&[]);
1511+
}
1512+
15081513
let buf = self.inner.fill_buf()?;
15091514
let cap = cmp::min(buf.len() as u64, self.limit) as usize;
15101515
Ok(&buf[..cap])
@@ -1860,9 +1865,16 @@ mod tests {
18601865
Err(io::Error::new(io::ErrorKind::Other, ""))
18611866
}
18621867
}
1868+
impl BufRead for R {
1869+
fn fill_buf(&mut self) -> io::Result<&[u8]> {
1870+
Err(io::Error::new(io::ErrorKind::Other, ""))
1871+
}
1872+
fn consume(&mut self, _amt: usize) { }
1873+
}
18631874

18641875
let mut buf = [0; 1];
18651876
assert_eq!(0, R.take(0).read(&mut buf).unwrap());
1877+
assert_eq!(b"", R.take(0).fill_buf().unwrap());
18661878
}
18671879

18681880
fn cmp_bufread<Br1: BufRead, Br2: BufRead>(mut br1: Br1, mut br2: Br2, exp: &[u8]) {

src/snapshots.txt

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ S 2016-03-18 235d774
66
winnt-i386 7703869608cc4192b8f1943e51b19ba1a03c0110
77
winnt-x86_64 8512b5ecc0c53a2cd3552e4f5688577de95cd978
88
openbsd-x86_64 c5b6feda38138a12cd5c05574b585dadebbb5e87
9+
freebsd-i386 b5a87e66e3e3eed5f0b68367ad22f25f0be2d4ea
910
freebsd-x86_64 390b9a9f60f3d0d6a52c04d939a0355f572d03b3
1011

1112
S 2016-02-17 4d3eebf

src/test/compile-fail/feature-gate-try-operator.rs

-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,5 @@ macro_rules! id {
1414

1515
fn main() {
1616
id!(x?); //~ error: the `?` operator is not stable (see issue #31436)
17-
//~^ help: add #![feature(question_mark)] to the crate attributes to enable
1817
y?; //~ error: the `?` operator is not stable (see issue #31436)
19-
//~^ help: add #![feature(question_mark)] to the crate attributes to enable
2018
}

0 commit comments

Comments
 (0)