Skip to content

Commit 1561b0c

Browse files
Store positive instead of negative fail_fast.
This makes later negation much easier to interpret.
1 parent 2df56a6 commit 1561b0c

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

src/bootstrap/check.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl fmt::Display for TestKind {
5959
}
6060

6161
fn try_run(build: &Build, cmd: &mut Command) {
62-
if build.flags.cmd.no_fail_fast() {
62+
if !build.fail_fast {
6363
if !build.try_run(cmd) {
6464
let failures = build.delayed_failures.get();
6565
build.delayed_failures.set(failures + 1);
@@ -70,7 +70,7 @@ fn try_run(build: &Build, cmd: &mut Command) {
7070
}
7171

7272
fn try_run_quiet(build: &Build, cmd: &mut Command) {
73-
if build.flags.cmd.no_fail_fast() {
73+
if !build.fail_fast {
7474
if !build.try_run_quiet(cmd) {
7575
let failures = build.delayed_failures.get();
7676
build.delayed_failures.set(failures + 1);
@@ -128,7 +128,7 @@ pub fn cargo(build: &Build, stage: u32, host: &str) {
128128

129129
let mut cargo = build.cargo(compiler, Mode::Tool, host, "test");
130130
cargo.arg("--manifest-path").arg(build.src.join("src/tools/cargo/Cargo.toml"));
131-
if build.flags.cmd.no_fail_fast() {
131+
if !build.fail_fast {
132132
cargo.arg("--no-fail-fast");
133133
}
134134

@@ -448,7 +448,7 @@ pub fn krate(build: &Build,
448448
cargo.arg("--manifest-path")
449449
.arg(build.src.join(path).join("Cargo.toml"))
450450
.arg("--features").arg(features);
451-
if test_kind.subcommand() == "test" && build.flags.cmd.no_fail_fast() {
451+
if test_kind.subcommand() == "test" && !build.fail_fast {
452452
cargo.arg("--no-fail-fast");
453453
}
454454

@@ -669,7 +669,7 @@ pub fn bootstrap(build: &Build) {
669669
.env("CARGO_TARGET_DIR", build.out.join("bootstrap"))
670670
.env("RUSTC_BOOTSTRAP", "1")
671671
.env("RUSTC", &build.initial_rustc);
672-
if build.flags.cmd.no_fail_fast() {
672+
if !build.fail_fast {
673673
cmd.arg("--no-fail-fast");
674674
}
675675
cmd.arg("--").args(&build.flags.cmd.test_args());

src/bootstrap/flags.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub enum Subcommand {
6161
Test {
6262
paths: Vec<PathBuf>,
6363
test_args: Vec<String>,
64-
no_fail_fast: bool,
64+
fail_fast: bool,
6565
},
6666
Bench {
6767
paths: Vec<PathBuf>,
@@ -278,7 +278,7 @@ Arguments:
278278
Subcommand::Test {
279279
paths: paths,
280280
test_args: matches.opt_strs("test-args"),
281-
no_fail_fast: matches.opt_present("no-fail-fast"),
281+
fail_fast: !matches.opt_present("no-fail-fast"),
282282
}
283283
}
284284
"bench" => {
@@ -354,9 +354,9 @@ impl Subcommand {
354354
}
355355
}
356356

357-
pub fn no_fail_fast(&self) -> bool {
357+
pub fn fail_fast(&self) -> bool {
358358
match *self {
359-
Subcommand::Test { no_fail_fast, .. } => no_fail_fast,
359+
Subcommand::Test { fail_fast, .. } => fail_fast,
360360
_ => false,
361361
}
362362
}

src/bootstrap/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ pub struct Build {
167167
cargo_info: channel::GitInfo,
168168
rls_info: channel::GitInfo,
169169
local_rebuild: bool,
170+
fail_fast: bool,
170171

171172
// Stage 0 (downloaded) compiler and cargo or their local rust equivalents.
172173
initial_rustc: PathBuf,
@@ -240,12 +241,12 @@ impl Build {
240241
let rust_info = channel::GitInfo::new(&src);
241242
let cargo_info = channel::GitInfo::new(&src.join("src/tools/cargo"));
242243
let rls_info = channel::GitInfo::new(&src.join("src/tools/rls"));
243-
let src_is_git = src.join(".git").exists();
244244

245245
Build {
246246
initial_rustc: config.initial_rustc.clone(),
247247
initial_cargo: config.initial_cargo.clone(),
248248
local_rebuild: config.local_rebuild,
249+
fail_fast: flags.cmd.fail_fast(),
249250

250251
flags: flags,
251252
config: config,

0 commit comments

Comments
 (0)