diff --git a/src/cargo/core/shell.rs b/src/cargo/core/shell.rs index a3e72b5261e..e1198f17689 100644 --- a/src/cargo/core/shell.rs +++ b/src/cargo/core/shell.rs @@ -308,8 +308,8 @@ impl Shell { } #[cfg(windows)] { - if let ShellOut::Stream { stream, .. } = &mut self.err { - ::fwdansi::write_ansi(stream, message)?; + if let ShellOut::Stream { stderr, .. } = &mut self.output { + ::fwdansi::write_ansi(stderr, message)?; return Ok(()); } } @@ -495,6 +495,6 @@ mod imp { fn default_err_erase_line(shell: &mut Shell) { if let Some(max_width) = imp::stderr_width() { let blank = " ".repeat(max_width); - drop(write!(shell.err.as_write(), "{}\r", blank)); + drop(write!(shell.output.stderr(), "{}\r", blank)); } } diff --git a/src/cargo/ops/fix.rs b/src/cargo/ops/fix.rs index ca21dcfdfd6..7c4834dba59 100644 --- a/src/cargo/ops/fix.rs +++ b/src/cargo/ops/fix.rs @@ -41,7 +41,6 @@ use std::collections::{BTreeSet, HashMap, HashSet}; use std::env; use std::ffi::OsString; -use std::io::Write; use std::path::{Path, PathBuf}; use std::process::{self, Command, ExitStatus}; use std::str; @@ -525,6 +524,7 @@ fn rustfix_and_fix( fn exit_with(status: ExitStatus) -> ! { #[cfg(unix)] { + use std::io::Write; use std::os::unix::prelude::*; if let Some(signal) = status.signal() { drop(writeln!(