Skip to content

Commit

Permalink
Auto merge of #32960 - steveklabnik:rollup, r=steveklabnik
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Apr 14, 2016
2 parents 2b5d24a + 7e2302b commit 2174bd9
Show file tree
Hide file tree
Showing 23 changed files with 77 additions and 30 deletions.
4 changes: 2 additions & 2 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ Compatibility Notes
numbers [no longer return platform-specific types][1.8r], but
instead return widened integers. [RFC 1415].
* [Modules sourced from the filesystem cannot appear within arbitrary
blocks, but only within other modules][1.8m].
blocks, but only within other modules][1.8mf].
* [`--cfg` compiler flags are parsed strictly as identifiers][1.8c].
* On Unix, [stack overflow triggers a runtime abort instead of a
SIGSEGV][1.8so].
Expand Down Expand Up @@ -448,7 +448,7 @@ Compatibility Notes
[1.8h]: https://github.com/rust-lang/rust/pull/31460
[1.8l]: https://github.com/rust-lang/rust/pull/31668
[1.8m]: https://github.com/rust-lang/rust/pull/31020
[1.8m]: https://github.com/rust-lang/rust/pull/31534
[1.8mf]: https://github.com/rust-lang/rust/pull/31534
[1.8mp]: https://github.com/rust-lang/rust/pull/30894
[1.8mr]: https://users.rust-lang.org/t/multirust-0-8-with-cross-std-installation/4901
[1.8ms]: https://github.com/rust-lang/rust/pull/30448
Expand Down
2 changes: 1 addition & 1 deletion mk/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
######################################################################

# The version number
CFG_RELEASE_NUM=1.9.0
CFG_RELEASE_NUM=1.10.0

# An optional number to put after the label, e.g. '.2' -> '-beta.2'
# NB Make sure it starts with a dot to conform to semver pre-release
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ path = "rustdoc.rs"

[dependencies]
build_helper = { path = "../build_helper" }
cmake = "0.1.10"
cmake = "0.1.17"
filetime = "0.1"
num_cpus = "0.2"
toml = "0.1"
Expand Down
4 changes: 3 additions & 1 deletion src/bootstrap/build/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use toml::{Parser, Decoder, Value};
#[derive(Default)]
pub struct Config {
pub ccache: bool,
pub ninja: bool,
pub verbose: bool,
pub submodules: bool,
pub compiler_docs: bool,
Expand Down Expand Up @@ -107,6 +108,7 @@ struct Build {
#[derive(RustcDecodable, Default)]
struct Llvm {
ccache: Option<bool>,
ninja: Option<bool>,
assertions: Option<bool>,
optimize: Option<bool>,
version_check: Option<bool>,
Expand Down Expand Up @@ -200,9 +202,9 @@ impl Config {

if let Some(ref llvm) = toml.llvm {
set(&mut config.ccache, llvm.ccache);
set(&mut config.ninja, llvm.ninja);
set(&mut config.llvm_assertions, llvm.assertions);
set(&mut config.llvm_optimize, llvm.optimize);
set(&mut config.llvm_optimize, llvm.optimize);
set(&mut config.llvm_version_check, llvm.version_check);
set(&mut config.llvm_static_stdcpp, llvm.static_libstdcpp);
}
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/build/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ pub fn llvm(build: &Build, target: &str) {

// http://llvm.org/docs/CMake.html
let mut cfg = cmake::Config::new(build.src.join("src/llvm"));
if build.config.ninja {
cfg.generator("Ninja");
}
cfg.target(target)
.host(&build.config.build)
.out_dir(&dst)
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/build/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ pub fn check(build: &mut Build) {
}
}
need_cmd("cmake".as_ref());
if build.config.ninja {
need_cmd("ninja".as_ref())
}
break
}

Expand Down
7 changes: 3 additions & 4 deletions src/doc/book/guessing-game.md
Original file line number Diff line number Diff line change
Expand Up @@ -988,8 +988,7 @@ fn main() {
# Complete!
At this point, you have successfully built the Guessing Game! Congratulations!
This project showed you a lot: `let`, `match`, methods, associated
functions, using external crates, and more.
This first project showed you a lot: `let`, `match`, methods, associated
functions, using external crates, and more. Our next project will show off
even more.
At this point, you have successfully built the Guessing Game! Congratulations!
4 changes: 2 additions & 2 deletions src/libcollections/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -634,9 +634,9 @@ impl str {
/// Basic usage:
///
/// ```
/// let s = "Per Martin-Löf";
/// let mut s = "Per Martin-Löf".to_string();
///
/// let (first, last) = s.split_at(3);
/// let (first, last) = s.split_at_mut(3);
///
/// assert_eq!("Per", first);
/// assert_eq!(" Martin-Löf", last);
Expand Down
16 changes: 16 additions & 0 deletions src/libcollectionstest/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,22 @@ fn test_slice_fail() {
&"中华Việt Nam"[0..2];
}


#[test]
fn test_is_char_boundary() {
let s = "ศไทย中华Việt Nam β-release 🐱123";
assert!(s.is_char_boundary(0));
assert!(s.is_char_boundary(s.len()));
assert!(!s.is_char_boundary(s.len() + 1));
for (i, ch) in s.char_indices() {
// ensure character locations are boundaries and continuation bytes are not
assert!(s.is_char_boundary(i), "{} is a char boundary in {:?}", i, s);
for j in 1..ch.len_utf8() {
assert!(!s.is_char_boundary(i + j),
"{} should not be a char boundary in {:?}", i + j, s);
}
}
}
const LOREM_PARAGRAPH: &'static str = "\
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse quis lorem sit amet dolor \
ultricies condimentum. Praesent iaculis purus elit, ac malesuada quam malesuada in. Duis sed orci \
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ macro_rules! debug_assert_eq {
/// fn write_to_file_using_match() -> Result<(), io::Error> {
/// let mut file = try!(File::create("my_best_friends.txt"));
/// match file.write_all(b"This is a list of my best friends.") {
/// Ok(_) => (),
/// Ok(v) => v,
/// Err(e) => return Err(e),
/// }
/// println!("I wrote to the file");
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
opt::multi_s("L", "", "Add a directory to the library search path",
"[KIND=]PATH"),
opt::multi_s("l", "", "Link the generated crate(s) to the specified native
library NAME. The optional KIND can be one of,
library NAME. The optional KIND can be one of
static, dylib, or framework. If omitted, dylib is
assumed.", "[KIND=]NAME"),
opt::multi_s("", "crate-type", "Comma separated list of types of crates
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_back/target/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
//! rustc will search each directory in the environment variable
//! `RUST_TARGET_PATH` for a file named `TRIPLE.json`. The first one found will
//! be loaded. If no file is found in any of those directories, a fatal error
//! will be given. `RUST_TARGET_PATH` includes `/etc/rustc` as its last entry,
//! to be searched by default.
//! will be given.
//!
//! Projects defining their own targets should use
//! `--target=path/to/my-awesome-platform.json` instead of adding to
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_const_eval/check_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

pub use self::Constructor::*;
use self::Constructor::*;
use self::Usefulness::*;
use self::WitnessPreference::*;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/build/matches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ impl<'a,'tcx> Builder<'a,'tcx> {
/// But there may also be candidates that the test just doesn't
/// apply to. For example, consider the case of #29740:
///
/// ```rust
/// ```rust,ignore
/// match x {
/// "foo" => ...,
/// "bar" => ...,
Expand Down
4 changes: 4 additions & 0 deletions src/librustc_mir/build/matches/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ impl<'a,'tcx> Builder<'a,'tcx> {
/// this function converts the prefix (`x`, `y`) and suffix (`z`) into
/// distinct match pairs:
///
/// ```rust,ignore
/// lv[0 of 3] @ x // see ProjectionElem::ConstantIndex (and its Debug impl)
/// lv[1 of 3] @ y // to explain the `[x of y]` notation
/// lv[-1 of 3] @ z
/// ```
///
/// If a slice like `s` is present, then the function also creates
/// a temporary like:
///
/// ```rust,ignore
/// tmp0 = lv[2..-1] // using the special Rvalue::Slice
/// ```
///
/// and creates a match pair `tmp0 @ s`
pub fn prefix_suffix_slice<'pat>(&mut self,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/build/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ set of scheduled drops up front, and so whenever we exit from the
scope we only drop the values scheduled thus far. For example, consider
the scope S corresponding to this loop:
```
```rust,ignore
loop {
let x = ...;
if cond { break; }
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const INDENT: &'static str = " ";
/// If the session is properly configured, dumps a human-readable
/// representation of the mir into:
///
/// ```
/// ```text
/// rustc.node<node_id>.<pass_name>.<disambiguator>
/// ```
///
Expand Down
10 changes: 10 additions & 0 deletions src/librustc_mir/traversal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ use rustc::mir::repr::*;
/// Preorder traversal is when each node is visited before an of it's
/// successors
///
/// ```text
///
/// A
/// / \
/// / \
/// B C
/// \ /
/// \ /
/// D
/// ```
///
/// A preorder traversal of this graph is either `A B D C` or `A C D B`
#[derive(Clone)]
Expand Down Expand Up @@ -80,13 +83,17 @@ impl<'a, 'tcx> Iterator for Preorder<'a, 'tcx> {
/// Postorder traversal is when each node is visited after all of it's
/// successors, except when the successor is only reachable by a back-edge
///
///
/// ```text
///
/// A
/// / \
/// / \
/// B C
/// \ /
/// \ /
/// D
/// ```
///
/// A Postorder traversal of this graph is `D B C A` or `D C B A`
pub struct Postorder<'a, 'tcx: 'a> {
Expand Down Expand Up @@ -215,13 +222,16 @@ impl<'a, 'tcx> Iterator for Postorder<'a, 'tcx> {
/// This is different to a preorder traversal and represents a natural
/// linearisation of control-flow.
///
/// ```text
///
/// A
/// / \
/// / \
/// B C
/// \ /
/// \ /
/// D
/// ```
///
/// A reverse postorder traversal of this graph is either `A B C D` or `A C B D`
/// Note that for a graph containing no loops (i.e. A DAG), this is equivalent to
Expand Down
14 changes: 7 additions & 7 deletions src/librustc_trans/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ use self::Opt::*;
use self::FailureHandler::*;

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

let ctor = match opt {
&ConstantValue(ConstantExpr(expr), _) => check_match::ConstantValue(
&ConstantValue(ConstantExpr(expr), _) => Constructor::ConstantValue(
eval_const_expr(bcx.tcx(), &expr)
),
&ConstantRange(ConstantExpr(lo), ConstantExpr(hi), _) => check_match::ConstantRange(
&ConstantRange(ConstantExpr(lo), ConstantExpr(hi), _) => Constructor::ConstantRange(
eval_const_expr(bcx.tcx(), &lo),
eval_const_expr(bcx.tcx(), &hi)
),
&SliceLengthEqual(n, _) =>
check_match::Slice(n),
Constructor::Slice(n),
&SliceLengthGreaterOrEqual(before, after, _) =>
check_match::SliceWithSubslice(before, after),
Constructor::SliceWithSubslice(before, after),
&Variant(_, _, def_id, _) =>
check_match::Constructor::Variant(def_id)
Constructor::Variant(def_id)
};

let param_env = bcx.tcx().empty_parameter_environment();
Expand Down Expand Up @@ -1229,7 +1229,7 @@ fn compile_submatch_continue<'a, 'p, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
Some(field_vals) => {
let pats = enter_match(bcx, dm, m, col, val, |pats|
check_match::specialize(&mcx, pats,
&check_match::Single, col,
&Constructor::Single, col,
field_vals.len())
);
let mut vals: Vec<_> = field_vals.into_iter()
Expand Down
12 changes: 12 additions & 0 deletions src/libstd/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,11 @@ impl<T: Read> Read for Take<T> {
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: BufRead> BufRead for Take<T> {
fn fill_buf(&mut self) -> Result<&[u8]> {
// Don't call into inner reader at all at EOF because it may still block
if self.limit == 0 {
return Ok(&[]);
}

let buf = self.inner.fill_buf()?;
let cap = cmp::min(buf.len() as u64, self.limit) as usize;
Ok(&buf[..cap])
Expand Down Expand Up @@ -1860,9 +1865,16 @@ mod tests {
Err(io::Error::new(io::ErrorKind::Other, ""))
}
}
impl BufRead for R {
fn fill_buf(&mut self) -> io::Result<&[u8]> {
Err(io::Error::new(io::ErrorKind::Other, ""))
}
fn consume(&mut self, _amt: usize) { }
}

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

fn cmp_bufread<Br1: BufRead, Br2: BufRead>(mut br1: Br1, mut br2: Br2, exp: &[u8]) {
Expand Down
1 change: 1 addition & 0 deletions src/snapshots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ S 2016-03-18 235d774
winnt-i386 7703869608cc4192b8f1943e51b19ba1a03c0110
winnt-x86_64 8512b5ecc0c53a2cd3552e4f5688577de95cd978
openbsd-x86_64 c5b6feda38138a12cd5c05574b585dadebbb5e87
freebsd-i386 b5a87e66e3e3eed5f0b68367ad22f25f0be2d4ea
freebsd-x86_64 390b9a9f60f3d0d6a52c04d939a0355f572d03b3

S 2016-02-17 4d3eebf
Expand Down
2 changes: 0 additions & 2 deletions src/test/compile-fail/feature-gate-try-operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@ macro_rules! id {

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

0 comments on commit 2174bd9

Please sign in to comment.