mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-02 18:12:51 +00:00
Set error handler output format as soon as possible
This commit is contained in:
parent
5bd28f5eac
commit
53245a17bb
@ -2405,6 +2405,8 @@ pub fn build_session_options(
|
||||
|
||||
let error_format = parse_error_format(handler, matches, color, json_rendered);
|
||||
|
||||
handler.abort_if_error_and_set_error_format(error_format);
|
||||
|
||||
let diagnostic_width = matches.opt_get("diagnostic-width").unwrap_or_else(|_| {
|
||||
handler.early_error("`--diagnostic-width` must be an positive integer");
|
||||
});
|
||||
|
3
tests/ui/diagnostic-flags/colored-session-opt-error.rs
Normal file
3
tests/ui/diagnostic-flags/colored-session-opt-error.rs
Normal file
@ -0,0 +1,3 @@
|
||||
// check-pass
|
||||
// compile-flags: -Cremark=foo --error-format=human --color always
|
||||
fn main() {}
|
@ -0,0 +1,2 @@
|
||||
[0m[1m[33mwarning[0m[0m[1m: -C remark requires "-C debuginfo=n" to show source locations[0m
|
||||
|
Loading…
Reference in New Issue
Block a user