Auto merge of #113127 - jieyouxu:fix-error-color-summary, r=davidtwco

Set error handler output format as soon as possible

Should fix https://github.com/rust-lang/rust/pull/112692#issuecomment-1611585904.
This commit is contained in:
bors 2023-07-10 00:10:53 +00:00
commit 02d1ee4834
10 changed files with 15 additions and 7 deletions

View file

@ -2524,6 +2524,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");
});