Skip to content

Commit a06baa5

Browse files
Format the world
1 parent 8eb7c58 commit a06baa5

File tree

1,160 files changed

+66321
-74703
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,160 files changed

+66321
-74703
lines changed

src/bootstrap/bin/llvm-config-wrapper.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// `src/bootstrap/native.rs` for why this is needed when compiling LLD.
33

44
use std::env;
5-
use std::process::{self, Stdio, Command};
65
use std::io::{self, Write};
6+
use std::process::{self, Command, Stdio};
77

88
fn main() {
99
let real_llvm_config = env::var_os("LLVM_CONFIG_REAL").unwrap();

src/bootstrap/bin/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
use std::env;
99

10-
use bootstrap::{Config, Build};
10+
use bootstrap::{Build, Config};
1111

1212
fn main() {
1313
let args = env::args().skip(1).collect::<Vec<_>>();

src/bootstrap/bin/rustc.rs

+24-22
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ fn main() {
2727

2828
// Detect whether or not we're a build script depending on whether --target
2929
// is passed (a bit janky...)
30-
let target = args.windows(2)
31-
.find(|w| &*w[0] == "--target")
32-
.and_then(|w| w[1].to_str());
30+
let target = args.windows(2).find(|w| &*w[0] == "--target").and_then(|w| w[1].to_str());
3331
let version = args.iter().find(|w| &**w == "-vV");
3432

3533
let verbose = match env::var("RUSTC_VERBOSE") {
@@ -57,19 +55,16 @@ fn main() {
5755
dylib_path.insert(0, PathBuf::from(&libdir));
5856

5957
let mut cmd = Command::new(rustc);
60-
cmd.args(&args)
61-
.env(bootstrap::util::dylib_path_var(),
62-
env::join_paths(&dylib_path).unwrap());
58+
cmd.args(&args).env(bootstrap::util::dylib_path_var(), env::join_paths(&dylib_path).unwrap());
6359

6460
// Get the name of the crate we're compiling, if any.
65-
let crate_name = args.windows(2)
66-
.find(|args| args[0] == "--crate-name")
67-
.and_then(|args| args[1].to_str());
61+
let crate_name =
62+
args.windows(2).find(|args| args[0] == "--crate-name").and_then(|args| args[1].to_str());
6863

6964
if let Some(crate_name) = crate_name {
7065
if let Some(target) = env::var_os("RUSTC_TIME") {
71-
if target == "all" ||
72-
target.into_string().unwrap().split(",").any(|c| c.trim() == crate_name)
66+
if target == "all"
67+
|| target.into_string().unwrap().split(",").any(|c| c.trim() == crate_name)
7368
{
7469
cmd.arg("-Ztime");
7570
}
@@ -101,15 +96,22 @@ fn main() {
10196
// `compiler_builtins` are unconditionally compiled with panic=abort to
10297
// workaround undefined references to `rust_eh_unwind_resume` generated
10398
// otherwise, see issue https://github.com/rust-lang/rust/issues/43095.
104-
if crate_name == Some("panic_abort") ||
105-
crate_name == Some("compiler_builtins") && stage != "0" {
99+
if crate_name == Some("panic_abort")
100+
|| crate_name == Some("compiler_builtins") && stage != "0"
101+
{
106102
cmd.arg("-C").arg("panic=abort");
107103
}
108104

109105
// Set various options from config.toml to configure how we're building
110106
// code.
111107
let debug_assertions = match env::var("RUSTC_DEBUG_ASSERTIONS") {
112-
Ok(s) => if s == "true" { "y" } else { "n" },
108+
Ok(s) => {
109+
if s == "true" {
110+
"y"
111+
} else {
112+
"n"
113+
}
114+
}
113115
Err(..) => "n",
114116
};
115117

@@ -178,17 +180,17 @@ fn main() {
178180
if env::var_os("RUSTC_PRINT_STEP_TIMINGS").is_some() {
179181
if let Some(crate_name) = crate_name {
180182
let start = Instant::now();
181-
let status = cmd
182-
.status()
183-
.unwrap_or_else(|_| panic!("\n\n failed to run {:?}", cmd));
183+
let status = cmd.status().unwrap_or_else(|_| panic!("\n\n failed to run {:?}", cmd));
184184
let dur = start.elapsed();
185185

186186
let is_test = args.iter().any(|a| a == "--test");
187-
eprintln!("[RUSTC-TIMING] {} test:{} {}.{:03}",
188-
crate_name,
189-
is_test,
190-
dur.as_secs(),
191-
dur.subsec_nanos() / 1_000_000);
187+
eprintln!(
188+
"[RUSTC-TIMING] {} test:{} {}.{:03}",
189+
crate_name,
190+
is_test,
191+
dur.as_secs(),
192+
dur.subsec_nanos() / 1_000_000
193+
);
192194

193195
match status.code() {
194196
Some(i) => std::process::exit(i),

src/bootstrap/bin/rustdoc.rs

+6-10
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
//! See comments in `src/bootstrap/rustc.rs` for more information.
44
55
use std::env;
6-
use std::process::Command;
7-
use std::path::PathBuf;
86
use std::ffi::OsString;
7+
use std::path::PathBuf;
8+
use std::process::Command;
99

1010
fn main() {
1111
let args = env::args_os().skip(1).collect::<Vec<_>>();
@@ -35,8 +35,7 @@ fn main() {
3535
.arg("dox")
3636
.arg("--sysroot")
3737
.arg(&sysroot)
38-
.env(bootstrap::util::dylib_path_var(),
39-
env::join_paths(&dylib_path).unwrap());
38+
.env(bootstrap::util::dylib_path_var(), env::join_paths(&dylib_path).unwrap());
4039

4140
// Force all crates compiled by this compiler to (a) be unstable and (b)
4241
// allow the `rustc_private` feature to link to other unstable crates
@@ -55,8 +54,7 @@ fn main() {
5554
if let Some(version) = env::var_os("RUSTDOC_CRATE_VERSION") {
5655
// This "unstable-options" can be removed when `--crate-version` is stabilized
5756
if !has_unstable {
58-
cmd.arg("-Z")
59-
.arg("unstable-options");
57+
cmd.arg("-Z").arg("unstable-options");
6058
}
6159
cmd.arg("--crate-version").arg(version);
6260
has_unstable = true;
@@ -66,8 +64,7 @@ fn main() {
6664
if let Some(_) = env::var_os("RUSTDOC_GENERATE_REDIRECT_PAGES") {
6765
// This "unstable-options" can be removed when `--generate-redirect-pages` is stabilized
6866
if !has_unstable {
69-
cmd.arg("-Z")
70-
.arg("unstable-options");
67+
cmd.arg("-Z").arg("unstable-options");
7168
}
7269
cmd.arg("--generate-redirect-pages");
7370
has_unstable = true;
@@ -77,8 +74,7 @@ fn main() {
7774
if let Some(ref x) = env::var_os("RUSTDOC_RESOURCE_SUFFIX") {
7875
// This "unstable-options" can be removed when `--resource-suffix` is stabilized
7976
if !has_unstable {
80-
cmd.arg("-Z")
81-
.arg("unstable-options");
77+
cmd.arg("-Z").arg("unstable-options");
8278
}
8379
cmd.arg("--resource-suffix").arg(x);
8480
}

src/bootstrap/bin/sccache-plus-cl.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ fn main() {
88
env::set_var("CXX", env::var_os("SCCACHE_CXX").unwrap());
99
let mut cfg = cc::Build::new();
1010
cfg.cargo_metadata(false)
11-
.out_dir("/")
12-
.target(&target)
13-
.host(&target)
14-
.opt_level(0)
15-
.warnings(false)
16-
.debug(false);
11+
.out_dir("/")
12+
.target(&target)
13+
.host(&target)
14+
.opt_level(0)
15+
.warnings(false)
16+
.debug(false);
1717
let compiler = cfg.get_compiler();
1818

1919
// Invoke sccache with said compiler

0 commit comments

Comments
 (0)