Skip to content

Commit 64f23b9

Browse files
committed
Hint when errors are hidden
1 parent dd99005 commit 64f23b9

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/cargo/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,8 @@ fn _display_error(err: &Error, shell: &mut Shell, as_err: bool) -> bool {
146146
for (i, err) in err.chain().enumerate() {
147147
// If we're not in verbose mode then only print cause chain until one
148148
// marked as `VerboseError` appears.
149-
//
150-
// Generally the top error shouldn't be verbose, but check it anyways.
151149
if shell.verbosity() != Verbose && err.is::<VerboseError>() {
150+
drop(shell.note("for more details, run again with '--verbose'"));
152151
return true;
153152
}
154153
if err.is::<AlreadyPrintedError>() {

tests/testsuite/check.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,7 @@ fn check_fixable_error_no_fix() {
12811281
{}\
12821282
[WARNING] `foo` (lib) generated 1 warning
12831283
[ERROR] could not compile `foo` due to previous error; 1 warning emitted
1284+
[NOTE] for more details, run again with '--verbose'
12841285
",
12851286
rustc_message
12861287
);

tests/testsuite/messages.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ fn deduplicate_errors() {
137137
"\
138138
[COMPILING] foo v0.0.1 [..]
139139
{}error: could not compile `foo` due to previous error
140+
[NOTE] for more details, run again with '--verbose'
140141
",
141142
rustc_message
142143
))

0 commit comments

Comments
 (0)