Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Don't suppress error messages with -q
If we're printing an error, make sure we always print it regardless of
verbosity settings!
  • Loading branch information
alexcrichton committed Jul 10, 2019
commit bdb0ce84e2d4b361d000e7418b7cf4edba65fc4b
5 changes: 4 additions & 1 deletion src/cargo/core/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ impl Shell {

/// Prints a red 'error' message.
pub fn error<T: fmt::Display>(&mut self, message: T) -> CargoResult<()> {
self.print(&"error:", Some(&message), Red, false)
if self.needs_clear {
self.err_erase_line();
}
self.err.print(&"error:", Some(&message), Red, false)
}

/// Prints an amber 'warning' message.
Expand Down
36 changes: 36 additions & 0 deletions tests/testsuite/workspaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2137,3 +2137,39 @@ fn ws_warn_path() {
.with_stderr_contains("[WARNING] [..]/foo/a/Cargo.toml: the cargo feature `edition`[..]")
.run();
}

#[cargo_test]
fn invalid_missing() {
// Warnings include path to manifest.
let p = project()
.file(
"Cargo.toml",
r#"
[package]
name = "foo"
version = "0.1.0"

[dependencies]
x = { path = 'x' }
"#,
)
.file("src/lib.rs", "")
.build();

p.cargo("build -q")
.with_status(101)
.with_stderr(
"\
error: [..]

Caused by:
[..]

Caused by:
[..]

Caused by:
[..]",
)
.run();
}