Skip to content

Commit f7a7a3f

Browse files
committed
Auto merge of #9229 - alexcrichton:fix-borrow-mut, r=ehuss
Fix a `BorrowMut` error when stdout is closed There was one location in the job queue where the shell is borrowed twice by accident, so instead hold the same borrow over both locations. Closes #9220
2 parents 7441e8c + 3f2ece7 commit f7a7a3f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/cargo/core/compiler/job_queue.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,13 +772,14 @@ impl<'cfg> DrainState<'cfg> {
772772
}
773773
}
774774
if cx.bcx.build_config.emit_json() {
775+
let mut shell = cx.bcx.config.shell();
775776
let msg = machine_message::BuildFinished {
776777
success: error.is_none(),
777778
}
778779
.to_json_string();
779-
if let Err(e) = writeln!(cx.bcx.config.shell().out(), "{}", msg) {
780+
if let Err(e) = writeln!(shell.out(), "{}", msg) {
780781
if error.is_some() {
781-
crate::display_error(&e.into(), &mut cx.bcx.config.shell());
782+
crate::display_error(&e.into(), &mut shell);
782783
} else {
783784
return Some(e.into());
784785
}

0 commit comments

Comments
 (0)