Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #39895

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
738b0f3
Clean up "pattern doesn't bind x" messages
estebank Feb 10, 2017
0d46cfe
Have only one presentation for binding consistency errors
estebank Feb 14, 2017
fa3e19f
fix
estebank Feb 14, 2017
0e6248d
Point to same binding in multiple patterns when possible
estebank Feb 14, 2017
2a45c0a
Sort patterns by pattern number
estebank Feb 14, 2017
4e43853
fix
estebank Feb 14, 2017
39de12f
Check inconsistent bindings in all arms
estebank Feb 15, 2017
c8292fc
Correct a typo in procedural macros chapter of the Book.
CBenoit Feb 15, 2017
f313646
test: Verify all sysroot crates are unstable
alexcrichton Feb 15, 2017
4a3c66a
[MIR] Make InlineAsm a Statement
nagisa Feb 15, 2017
1fbbe79
Fix wording in LocalKey documentation
Feb 15, 2017
ab57e7b
std::io::cursor Added test for seeking beyond i64.
amosonn Feb 16, 2017
a2d176e
std::io::cursor: Fixed Seek so test passes.
amosonn Feb 16, 2017
a7f63d1
Remove noop method `Substs::params()`
estebank Feb 16, 2017
36b00cf
Correct a typo in procedural macros chapter of the Book. (fixup [c829…
CBenoit Feb 16, 2017
01cb587
Simplify wording of diagnostic message
estebank Feb 16, 2017
0e45a5e
[rustbuild] add a way to run command after failure
nagisa Feb 16, 2017
047a215
Set rustdoc --test files' path relative to the current directory
GuillaumeGomez Feb 15, 2017
45e953c
Rollup merge of #39713 - estebank:issue-39698, r=jonathandturner
frewsxcv Feb 17, 2017
7bd6e71
Rollup merge of #39847 - CBenoit:patch-1, r=frewsxcv
frewsxcv Feb 17, 2017
bcacdc3
Rollup merge of #39851 - alexcrichton:verify-unstable, r=brson
frewsxcv Feb 17, 2017
5430487
Rollup merge of #39854 - nagisa:mir-asm-stmt, r=nikomatsakis
frewsxcv Feb 17, 2017
f3d4c8c
Rollup merge of #39859 - GuillaumeGomez:rustdoc-test-relative-path, r…
frewsxcv Feb 17, 2017
f03656a
Rollup merge of #39862 - stjepang:fix-wording-localkey, r=GuillaumeGomez
frewsxcv Feb 17, 2017
2774728
Rollup merge of #39874 - amosonn:master, r=alexcrichton
frewsxcv Feb 17, 2017
a820dc3
Rollup merge of #39877 - estebank:remove-params, r=petrochenkov
frewsxcv Feb 17, 2017
79d4c84
Rollup merge of #39888 - nagisa:on-fail-bootstrap, r=alexcrichton
frewsxcv Feb 17, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions src/Cargo.lock

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

4 changes: 2 additions & 2 deletions src/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
members = [
"bootstrap",
"rustc",
"rustc/std_shim",
"rustc/test_shim",
"libstd",
"libtest",
"tools/cargotest",
"tools/compiletest",
"tools/error_index_generator",
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ build/
The current build is unfortunately not quite as simple as `cargo build` in a
directory, but rather the compiler is split into three different Cargo projects:

* `src/rustc/std_shim` - a project which builds and compiles libstd
* `src/rustc/test_shim` - a project which builds and compiles libtest
* `src/libstd` - the standard library
* `src/libtest` - testing support, depends on libstd
* `src/rustc` - the actual compiler itself

Each "project" has a corresponding Cargo.lock file with all dependencies, and
Expand Down
18 changes: 15 additions & 3 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ fn main() {
};
let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set");
let sysroot = env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was not set");
let mut on_fail = env::var_os("RUSTC_ON_FAIL").map(|of| Command::new(of));

let rustc = env::var_os(rustc).unwrap_or_else(|| panic!("{:?} was not set", rustc));
let libdir = env::var_os(libdir).unwrap_or_else(|| panic!("{:?} was not set", libdir));
Expand Down Expand Up @@ -212,9 +213,20 @@ fn main() {
}

// Actually run the compiler!
std::process::exit(match exec_cmd(&mut cmd) {
Ok(s) => s.code().unwrap_or(0xfe),
Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),
std::process::exit(if let Some(ref mut on_fail) = on_fail {
match cmd.status() {
Ok(s) if s.success() => 0,
_ => {
println!("\nDid not run successfully:\n{:?}\n-------------", cmd);
exec_cmd(on_fail).expect("could not run the backup command");
1
}
}
} else {
std::process::exit(match exec_cmd(&mut cmd) {
Ok(s) => s.code().unwrap_or(0xfe),
Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),
})
})
}

Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,10 @@ pub fn krate(build: &Build,
krate: Option<&str>) {
let (name, path, features, root) = match mode {
Mode::Libstd => {
("libstd", "src/rustc/std_shim", build.std_features(), "std_shim")
("libstd", "src/libstd", build.std_features(), "std")
}
Mode::Libtest => {
("libtest", "src/rustc/test_shim", String::new(), "test_shim")
("libtest", "src/libtest", String::new(), "test")
}
Mode::Librustc => {
("librustc", "src/rustc", build.rustc_features(), "rustc-main")
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn std(build: &Build, target: &str, compiler: &Compiler) {
}
cargo.arg("--features").arg(features)
.arg("--manifest-path")
.arg(build.src.join("src/rustc/std_shim/Cargo.toml"));
.arg(build.src.join("src/libstd/Cargo.toml"));

if let Some(target) = build.config.target_config.get(target) {
if let Some(ref jemalloc) = target.jemalloc {
Expand Down Expand Up @@ -162,7 +162,7 @@ pub fn test(build: &Build, target: &str, compiler: &Compiler) {
build.clear_if_dirty(&out_dir, &libstd_stamp(build, compiler, target));
let mut cargo = build.cargo(compiler, Mode::Libtest, target, "build");
cargo.arg("--manifest-path")
.arg(build.src.join("src/rustc/test_shim/Cargo.toml"));
.arg(build.src.join("src/libtest/Cargo.toml"));
build.run(&mut cargo);
update_mtime(build, &libtest_stamp(build, compiler, target));
}
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ pub fn std(build: &Build, stage: u32, target: &str) {

let mut cargo = build.cargo(&compiler, Mode::Libstd, target, "doc");
cargo.arg("--manifest-path")
.arg(build.src.join("src/rustc/std_shim/Cargo.toml"))
.arg(build.src.join("src/libstd/Cargo.toml"))
.arg("--features").arg(build.std_features());

// We don't want to build docs for internal std dependencies unless
Expand Down Expand Up @@ -198,7 +198,7 @@ pub fn test(build: &Build, stage: u32, target: &str) {

let mut cargo = build.cargo(&compiler, Mode::Libtest, target, "doc");
cargo.arg("--manifest-path")
.arg(build.src.join("src/rustc/test_shim/Cargo.toml"));
.arg(build.src.join("src/libtest/Cargo.toml"));
build.run(&mut cargo);
cp_r(&out_dir, &out)
}
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use step;
/// Deserialized version of all flags for this compile.
pub struct Flags {
pub verbose: usize, // verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
pub on_fail: Option<String>,
pub stage: Option<u32>,
pub keep_stage: Option<u32>,
pub build: String,
Expand Down Expand Up @@ -81,6 +82,7 @@ impl Flags {
opts.optopt("", "build", "build target of the stage0 compiler", "BUILD");
opts.optmulti("", "host", "host targets to build", "HOST");
opts.optmulti("", "target", "target targets to build", "TARGET");
opts.optopt("", "on-fail", "command to run on failure", "CMD");
opts.optopt("", "stage", "stage to build", "N");
opts.optopt("", "keep-stage", "stage to keep without recompiling", "N");
opts.optopt("", "src", "path to the root of the rust checkout", "DIR");
Expand Down Expand Up @@ -283,6 +285,7 @@ To learn more about a subcommand, run `./x.py <command> -h`
Flags {
verbose: m.opt_count("v"),
stage: stage,
on_fail: m.opt_str("on-fail"),
keep_stage: m.opt_str("keep-stage").map(|j| j.parse().unwrap()),
build: m.opt_str("build").unwrap_or_else(|| {
env::var("BUILD").unwrap()
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,10 @@ impl Build {
cargo.env("RUSTC_INCREMENTAL", incr_dir);
}

if let Some(ref on_fail) = self.flags.on_fail {
cargo.env("RUSTC_ON_FAIL", on_fail);
}

let verbose = cmp::max(self.config.verbose, self.flags.verbose);
cargo.env("RUSTC_VERBOSE", format!("{}", verbose));

Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ struct ResolveNode {
}

pub fn build(build: &mut Build) {
build_krate(build, "src/rustc/std_shim");
build_krate(build, "src/rustc/test_shim");
build_krate(build, "src/libstd");
build_krate(build, "src/libtest");
build_krate(build, "src/rustc");
}

Expand Down
50 changes: 25 additions & 25 deletions src/bootstrap/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,14 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
crate_rule(build,
&mut rules,
"libstd-link",
"build-crate-std_shim",
"build-crate-std",
compile::std_link)
.dep(|s| s.name("startup-objects"))
.dep(|s| s.name("create-sysroot").target(s.host));
crate_rule(build,
&mut rules,
"libtest-link",
"build-crate-test_shim",
"build-crate-test",
compile::test_link)
.dep(|s| s.name("libstd-link"));
crate_rule(build,
Expand All @@ -263,13 +263,13 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
compile::rustc_link)
.dep(|s| s.name("libtest-link"));

for (krate, path, _default) in krates("std_shim") {
for (krate, path, _default) in krates("std") {
rules.build(&krate.build_step, path)
.dep(|s| s.name("startup-objects"))
.dep(move |s| s.name("rustc").host(&build.config.build).target(s.host))
.run(move |s| compile::std(build, s.target, &s.compiler()));
}
for (krate, path, _default) in krates("test_shim") {
for (krate, path, _default) in krates("test") {
rules.build(&krate.build_step, path)
.dep(|s| s.name("libstd-link"))
.run(move |s| compile::test(build, s.target, &s.compiler()));
Expand Down Expand Up @@ -384,7 +384,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
"pretty", "run-fail-fulldeps");
}

for (krate, path, _default) in krates("std_shim") {
for (krate, path, _default) in krates("std") {
rules.test(&krate.test_step, path)
.dep(|s| s.name("libtest"))
.dep(|s| s.name("emulator-copy-libs"))
Expand All @@ -400,7 +400,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
Mode::Libstd, TestKind::Test, None));

// std benchmarks
for (krate, path, _default) in krates("std_shim") {
for (krate, path, _default) in krates("std") {
rules.bench(&krate.bench_step, path)
.dep(|s| s.name("libtest"))
.dep(|s| s.name("emulator-copy-libs"))
Expand All @@ -415,7 +415,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
.run(move |s| check::krate(build, &s.compiler(), s.target,
Mode::Libstd, TestKind::Bench, None));

for (krate, path, _default) in krates("test_shim") {
for (krate, path, _default) in krates("test") {
rules.test(&krate.test_step, path)
.dep(|s| s.name("libtest"))
.dep(|s| s.name("emulator-copy-libs"))
Expand Down Expand Up @@ -583,13 +583,13 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
.default(build.config.docs)
.host(true)
.run(move |s| doc::error_index(build, s.target));
for (krate, path, default) in krates("std_shim") {
for (krate, path, default) in krates("std") {
rules.doc(&krate.doc_step, path)
.dep(|s| s.name("libstd-link"))
.default(default && build.config.docs)
.run(move |s| doc::std(build, s.stage, s.target));
}
for (krate, path, default) in krates("test_shim") {
for (krate, path, default) in krates("test") {
rules.doc(&krate.doc_step, path)
.dep(|s| s.name("libtest-link"))
.default(default && build.config.compiler_docs)
Expand Down Expand Up @@ -1154,23 +1154,23 @@ mod tests {

let mut build = Build::new(flags, config);
let cwd = env::current_dir().unwrap();
build.crates.insert("std_shim".to_string(), ::Crate {
name: "std_shim".to_string(),
build.crates.insert("std".to_string(), ::Crate {
name: "std".to_string(),
deps: Vec::new(),
path: cwd.join("src/std_shim"),
doc_step: "doc-std_shim".to_string(),
build_step: "build-crate-std_shim".to_string(),
test_step: "test-std_shim".to_string(),
bench_step: "bench-std_shim".to_string(),
path: cwd.join("src/std"),
doc_step: "doc-std".to_string(),
build_step: "build-crate-std".to_string(),
test_step: "test-std".to_string(),
bench_step: "bench-std".to_string(),
});
build.crates.insert("test_shim".to_string(), ::Crate {
name: "test_shim".to_string(),
build.crates.insert("test".to_string(), ::Crate {
name: "test".to_string(),
deps: Vec::new(),
path: cwd.join("src/test_shim"),
doc_step: "doc-test_shim".to_string(),
build_step: "build-crate-test_shim".to_string(),
test_step: "test-test_shim".to_string(),
bench_step: "bench-test_shim".to_string(),
path: cwd.join("src/test"),
doc_step: "doc-test".to_string(),
build_step: "build-crate-test".to_string(),
test_step: "test-test".to_string(),
bench_step: "bench-test".to_string(),
});
build.crates.insert("rustc-main".to_string(), ::Crate {
name: "rustc-main".to_string(),
Expand Down Expand Up @@ -1360,7 +1360,7 @@ mod tests {
let all = rules.expand(&plan);
println!("all rules: {:#?}", all);
assert!(!all.contains(&step.name("rustc")));
assert!(!all.contains(&step.name("build-crate-std_shim").stage(1)));
assert!(!all.contains(&step.name("build-crate-std").stage(1)));

// all stage0 compiles should be for the build target, A
for step in all.iter().filter(|s| s.stage == 0) {
Expand Down Expand Up @@ -1425,7 +1425,7 @@ mod tests {

assert!(!plan.iter().any(|s| s.name.contains("rustc")));
assert!(plan.iter().all(|s| {
!s.name.contains("test_shim") || s.target == "C"
!s.name.contains("test") || s.target == "C"
}));
}

Expand Down
2 changes: 1 addition & 1 deletion src/doc/book/src/procedural-macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ So this is where quotes comes in. The `ast` argument is a struct that gives us
a representation of our type (which can be either a `struct` or an `enum`).
Check out the [docs](https://docs.rs/syn/0.10.5/syn/struct.MacroInput.html),
there is some useful information there. We are able to get the name of the
type using `ast.ident`. The `quote!` macro let's us write up the Rust code
type using `ast.ident`. The `quote!` macro lets us write up the Rust code
that we wish to return and convert it into `Tokens`. `quote!` let's us use some
really cool templating mechanics; we simply write `#name` and `quote!` will
replace it with the variable named `name`. You can even do some repetition
Expand Down
12 changes: 0 additions & 12 deletions src/liballoc_jemalloc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,6 @@ mod imp {
let flags = align_to_flags(align);
unsafe { nallocx(size as size_t, flags) as usize }
}

// These symbols are used by jemalloc on android but the really old android
// we're building on doesn't have them defined, so just make sure the symbols
// are available.
#[no_mangle]
#[cfg(all(target_os = "android", not(cargobuild)))]
pub extern "C" fn pthread_atfork(_prefork: *mut u8,
_postfork_parent: *mut u8,
_postfork_child: *mut u8)
-> i32 {
0
}
}

#[cfg(dummy_jemalloc)]
Expand Down
21 changes: 10 additions & 11 deletions src/librustc/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,12 @@ pub enum StatementKind<'tcx> {
/// End the current live range for the storage of the local.
StorageDead(Lvalue<'tcx>),

InlineAsm {
asm: InlineAsm,
outputs: Vec<Lvalue<'tcx>>,
inputs: Vec<Operand<'tcx>>
},

/// No-op. Useful for deleting instructions without affecting statement indices.
Nop,
}
Expand All @@ -790,7 +796,10 @@ impl<'tcx> Debug for Statement<'tcx> {
StorageDead(ref lv) => write!(fmt, "StorageDead({:?})", lv),
SetDiscriminant{lvalue: ref lv, variant_index: index} => {
write!(fmt, "discriminant({:?}) = {:?}", lv, index)
}
},
InlineAsm { ref asm, ref outputs, ref inputs } => {
write!(fmt, "asm!({:?} : {:?} : {:?})", asm, outputs, inputs)
},
Nop => write!(fmt, "nop"),
}
}
Expand Down Expand Up @@ -1004,12 +1013,6 @@ pub enum Rvalue<'tcx> {
/// that `Foo` has a destructor. These rvalues can be optimized
/// away after type-checking and before lowering.
Aggregate(AggregateKind<'tcx>, Vec<Operand<'tcx>>),

InlineAsm {
asm: InlineAsm,
outputs: Vec<Lvalue<'tcx>>,
inputs: Vec<Operand<'tcx>>
}
}

#[derive(Clone, Copy, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable)]
Expand Down Expand Up @@ -1111,10 +1114,6 @@ impl<'tcx> Debug for Rvalue<'tcx> {
UnaryOp(ref op, ref a) => write!(fmt, "{:?}({:?})", op, a),
Discriminant(ref lval) => write!(fmt, "discriminant({:?})", lval),
Box(ref t) => write!(fmt, "Box({:?})", t),
InlineAsm { ref asm, ref outputs, ref inputs } => {
write!(fmt, "asm!({:?} : {:?} : {:?})", asm, outputs, inputs)
}

Ref(_, borrow_kind, ref lv) => {
let kind_str = match borrow_kind {
BorrowKind::Shared => "",
Expand Down
1 change: 0 additions & 1 deletion src/librustc/mir/tcx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ impl<'tcx> Rvalue<'tcx> {
}
}
}
Rvalue::InlineAsm { .. } => None
}
}
}
Expand Down
Loading