From d7bc2937464b760d69ae8fc1146b660dc867e802 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 16 Jun 2018 18:46:54 +0200 Subject: [PATCH] Solve review comment --- src/bootstrap/compile.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index e23566d52f0..524df9587da 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -645,14 +645,13 @@ fn should_run(run: ShouldRun) -> ShouldRun { fn make_run(run: RunConfig) { let backend = run.builder.config.rust_codegen_backends.get(0); - let backend = backend.cloned().unwrap_or_else(|| { - INTERNER.intern_str("llvm") - }); - run.builder.ensure(CodegenBackend { - compiler: run.builder.compiler(run.builder.top_stage, run.host), - target: run.target, - backend, - }); + if let Some(backend) = backend.cloned() { + run.builder.ensure(CodegenBackend { + compiler: run.builder.compiler(run.builder.top_stage, run.host), + target: run.target, + backend, + }); + } } fn run(self, builder: &Builder) { @@ -677,9 +676,7 @@ fn run(self, builder: &Builder) { .arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml")); rustc_cargo_env(builder, &mut cargo); - if !backend.is_empty() { - features += &build_codegen_backend(&builder, &mut cargo, &compiler, target, backend); - } + features += &build_codegen_backend(&builder, &mut cargo, &compiler, target, backend); let tmp_stamp = builder.cargo_out(compiler, Mode::Codegen, target) .join(".tmp.stamp");