Skip to content

Commit 9fc1378

Browse files
committed
Report correct unsupported crate type for the dummy codegen backend
1 parent b443a59 commit 9fc1378

File tree

1 file changed

+3
-4
lines changed
  • compiler/rustc_interface/src

1 file changed

+3
-4
lines changed

compiler/rustc_interface/src/util.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,17 +388,16 @@ impl CodegenBackend for DummyCodegenBackend {
388388
) {
389389
// JUSTIFICATION: TyCtxt no longer available here
390390
#[allow(rustc::bad_opt_access)]
391-
if codegen_results
391+
if let Some(&crate_type) = codegen_results
392392
.crate_info
393393
.crate_types
394394
.iter()
395-
.any(|&crate_type| crate_type != CrateType::Rlib)
395+
.find(|&&crate_type| crate_type != CrateType::Rlib)
396396
{
397397
#[allow(rustc::untranslatable_diagnostic)]
398398
#[allow(rustc::diagnostic_outside_of_impl)]
399399
sess.dcx().fatal(format!(
400-
"crate type {} not supported by the dummy codegen backend",
401-
codegen_results.crate_info.crate_types[0],
400+
"crate type {crate_type} not supported by the dummy codegen backend"
402401
));
403402
}
404403

0 commit comments

Comments
 (0)