Skip to content

Commit 27d9691

Browse files
committed
Do not test RLS and rustfmt if build of these failed.
Avoid a tool being simultaneously test-pass and build-fail.
1 parent 6586074 commit 27d9691

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/bootstrap/test.rs

+20-2
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,16 @@ impl Step for Rls {
241241
let host = self.host;
242242
let compiler = builder.compiler(stage, host);
243243

244-
builder.ensure(tool::Rls { compiler, target: self.host, extra_features: Vec::new() });
244+
let build_result = builder.ensure(tool::Rls {
245+
compiler,
246+
target: self.host,
247+
extra_features: Vec::new(),
248+
});
249+
if build_result.is_none() {
250+
eprintln!("failed to test rls: could not build");
251+
return;
252+
}
253+
245254
let mut cargo = tool::prepare_tool_cargo(builder,
246255
compiler,
247256
host,
@@ -286,7 +295,16 @@ impl Step for Rustfmt {
286295
let host = self.host;
287296
let compiler = builder.compiler(stage, host);
288297

289-
builder.ensure(tool::Rustfmt { compiler, target: self.host, extra_features: Vec::new() });
298+
let build_result = builder.ensure(tool::Rustfmt {
299+
compiler,
300+
target: self.host,
301+
extra_features: Vec::new(),
302+
});
303+
if build_result.is_none() {
304+
eprintln!("failed to test rustfmt: could not build");
305+
return;
306+
}
307+
290308
let mut cargo = tool::prepare_tool_cargo(builder,
291309
compiler,
292310
host,

0 commit comments

Comments
 (0)