Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't emit explain with json short messages. #64753

Merged
merged 1 commit into from
Sep 25, 2019
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
7 changes: 7 additions & 0 deletions src/libsyntax/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ impl Emitter for JsonEmitter {
panic!("failed to print notification: {:?}", e);
}
}

fn should_show_explain(&self) -> bool {
match self.json_rendered {
HumanReadableErrorType::Short(_) => false,
_ => true,
}
}
}

// The following data types are provided just for serialisation.
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/json-short.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@ started: https://doc.rust-lang.org/book/
"}
{"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error
"}
{"message":"For more information about this error, try `rustc --explain E0601`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0601`.
"}