Skip to content

Commit f2d1e37

Browse files
committed
Auto merge of #14453 - Mark-Simulacrum:debug-no-errors, r=weihanglo
Log details of failure if no errors were seen ### What does this PR try to resolve? Crater has started (some time ago, though exact point is not known) to see failures in crates without logging an error. We're suspecting that there's something wrong in Cargo or rustc, but it's also possible that Crater itself is at fault. In any case, this should provide more details. cc rust-lang/crater#733 ### How should we test and review this PR? My hope is that this is reasonable to land without additional tests -- as-is, we expect it to never happen (there's even a debug assert later in the same code path) but it seems it *is* happening sometimes in the wild.
2 parents 3d2cf56 + ecfc899 commit f2d1e37

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/cargo/core/compiler/mod.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,17 @@ fn rustc(
409409
)
410410
},
411411
)
412-
.map_err(verbose_if_simple_exit_code)
412+
.map_err(|e| {
413+
if output_options.errors_seen == 0 {
414+
// If we didn't expect an error, do not require --verbose to fail.
415+
// This is intended to debug
416+
// https://github.com/rust-lang/crater/issues/733, where we are seeing
417+
// Cargo exit unsuccessfully while seeming to not show any errors.
418+
e
419+
} else {
420+
verbose_if_simple_exit_code(e)
421+
}
422+
})
413423
.with_context(|| {
414424
// adapted from rustc_errors/src/lib.rs
415425
let warnings = match output_options.warnings_seen {

0 commit comments

Comments
 (0)