Skip to content

Commit 554a58d

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

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

compiler/rustc_interface/src/util.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,17 +388,17 @@ 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!(
400400
"crate type {} not supported by the dummy codegen backend",
401-
codegen_results.crate_info.crate_types[0],
401+
crate_type,
402402
));
403403
}
404404

0 commit comments

Comments
 (0)