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
This commit is contained in:
commit
2174bd97c1
@ -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].
|
||||
@ -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
|
||||
|
@ -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
|
||||
|
4
src/bootstrap/Cargo.lock
generated
4
src/bootstrap/Cargo.lock
generated
@ -3,7 +3,7 @@ name = "bootstrap"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"build_helper 0.1.0",
|
||||
"cmake 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gcc 0.3.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -21,7 +21,7 @@ version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "cmake"
|
||||
version = "0.1.16"
|
||||
version = "0.1.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"gcc 0.3.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -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"
|
||||
|
@ -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,
|
||||
@ -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>,
|
||||
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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!
|
||||
|
@ -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);
|
||||
|
@ -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 \
|
||||
|
@ -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");
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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::*;
|
||||
|
||||
|
@ -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" => ...,
|
||||
|
@ -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,
|
||||
|
@ -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; }
|
||||
|
@ -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>
|
||||
/// ```
|
||||
///
|
||||
|
@ -19,6 +19,8 @@ use rustc::mir::repr::*;
|
||||
/// Preorder traversal is when each node is visited before an of it's
|
||||
/// successors
|
||||
///
|
||||
/// ```text
|
||||
///
|
||||
/// A
|
||||
/// / \
|
||||
/// / \
|
||||
@ -26,6 +28,7 @@ use rustc::mir::repr::*;
|
||||
/// \ /
|
||||
/// \ /
|
||||
/// D
|
||||
/// ```
|
||||
///
|
||||
/// A preorder traversal of this graph is either `A B D C` or `A C D B`
|
||||
#[derive(Clone)]
|
||||
@ -80,6 +83,9 @@ 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
|
||||
/// / \
|
||||
/// / \
|
||||
@ -87,6 +93,7 @@ impl<'a, 'tcx> Iterator for Preorder<'a, 'tcx> {
|
||||
/// \ /
|
||||
/// \ /
|
||||
/// D
|
||||
/// ```
|
||||
///
|
||||
/// A Postorder traversal of this graph is `D B C A` or `D C B A`
|
||||
pub struct Postorder<'a, 'tcx: 'a> {
|
||||
@ -215,6 +222,8 @@ 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
|
||||
/// / \
|
||||
/// / \
|
||||
@ -222,6 +231,7 @@ impl<'a, 'tcx> Iterator for Postorder<'a, 'tcx> {
|
||||
/// \ /
|
||||
/// \ /
|
||||
/// 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
|
||||
|
@ -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;
|
||||
@ -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();
|
||||
@ -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()
|
||||
|
@ -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])
|
||||
@ -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]) {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user