run rustfmt on bootstrap/bin folder

This commit is contained in:
Srinivas Reddy Thatiparthy
2016-10-16 14:57:25 +05:30
parent 6dc035ed91
commit abc715e985
2 changed files with 16 additions and 13 deletions

View File

@@ -36,7 +36,8 @@ fn main() {
let args = env::args_os().skip(1).collect::<Vec<_>>(); let args = env::args_os().skip(1).collect::<Vec<_>>();
// Detect whether or not we're a build script depending on whether --target // Detect whether or not we're a build script depending on whether --target
// is passed (a bit janky...) // is passed (a bit janky...)
let target = args.windows(2).find(|w| &*w[0] == "--target") let target = args.windows(2)
.find(|w| &*w[0] == "--target")
.and_then(|w| w[1].to_str()); .and_then(|w| w[1].to_str());
let version = args.iter().find(|w| &**w == "-vV"); let version = args.iter().find(|w| &**w == "-vV");
@@ -64,7 +65,8 @@ fn main() {
let mut cmd = Command::new(rustc); let mut cmd = Command::new(rustc);
cmd.args(&args) cmd.args(&args)
.arg("--cfg").arg(format!("stage{}", stage)) .arg("--cfg")
.arg(format!("stage{}", stage))
.env(bootstrap::util::dylib_path_var(), .env(bootstrap::util::dylib_path_var(),
env::join_paths(&dylib_path).unwrap()); env::join_paths(&dylib_path).unwrap());
@@ -101,9 +103,8 @@ fn main() {
// This... is a bit of a hack how we detect this. Ideally this // This... is a bit of a hack how we detect this. Ideally this
// information should be encoded in the crate I guess? Would likely // information should be encoded in the crate I guess? Would likely
// require an RFC amendment to RFC 1513, however. // require an RFC amendment to RFC 1513, however.
let is_panic_abort = args.windows(2).any(|a| { let is_panic_abort = args.windows(2)
&*a[0] == "--crate-name" && &*a[1] == "panic_abort" .any(|a| &*a[0] == "--crate-name" && &*a[1] == "panic_abort");
});
if is_panic_abort { if is_panic_abort {
cmd.arg("-C").arg("panic=abort"); cmd.arg("-C").arg("panic=abort");
} }
@@ -114,7 +115,7 @@ fn main() {
cmd.arg("-g"); cmd.arg("-g");
} }
let debug_assertions = match env::var("RUSTC_DEBUG_ASSERTIONS") { let debug_assertions = match env::var("RUSTC_DEBUG_ASSERTIONS") {
Ok(s) => if s == "true" {"y"} else {"n"}, Ok(s) => if s == "true" { "y" } else { "n" },
Err(..) => "n", Err(..) => "n",
}; };
cmd.arg("-C").arg(format!("debug-assertions={}", debug_assertions)); cmd.arg("-C").arg(format!("debug-assertions={}", debug_assertions));

View File

@@ -29,8 +29,10 @@ fn main() {
let mut cmd = Command::new(rustdoc); let mut cmd = Command::new(rustdoc);
cmd.args(&args) cmd.args(&args)
.arg("--cfg").arg(format!("stage{}", stage)) .arg("--cfg")
.arg("--cfg").arg("dox") .arg(format!("stage{}", stage))
.arg("--cfg")
.arg("dox")
.env(bootstrap::util::dylib_path_var(), .env(bootstrap::util::dylib_path_var(),
env::join_paths(&dylib_path).unwrap()); env::join_paths(&dylib_path).unwrap());
std::process::exit(match cmd.status() { std::process::exit(match cmd.status() {