Skip to content

Commit a0e5aea

Browse files
committed
inject_panic_runtime(): Avoid double negation for 'any non rlib'
1 parent a00df61 commit a0e5aea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_metadata/src/creader.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -701,8 +701,8 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
701701
fn inject_panic_runtime(&mut self, krate: &ast::Crate) {
702702
// If we're only compiling an rlib, then there's no need to select a
703703
// panic runtime, so we just skip this section entirely.
704-
let any_non_rlib = self.tcx.crate_types().iter().any(|ct| *ct != CrateType::Rlib);
705-
if !any_non_rlib {
704+
let only_rlib = self.tcx.crate_types().iter().all(|ct| *ct == CrateType::Rlib);
705+
if only_rlib {
706706
info!("panic runtime injection skipped, only generating rlib");
707707
return;
708708
}

0 commit comments

Comments
 (0)