Set error handler output format as soon as possible

This commit is contained in:
许杰友 Jieyou Xu (Joe) 2023-06-28 23:51:12 +08:00
parent 5bd28f5eac
commit 53245a17bb
No known key found for this signature in database
GPG Key ID: C5FD5D32014FDB47
3 changed files with 7 additions and 0 deletions

View File

@ -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");
});

View File

@ -0,0 +1,3 @@
// check-pass
// compile-flags: -Cremark=foo --error-format=human --color always
fn main() {}

View File

@ -0,0 +1,2 @@
warning: -C remark requires "-C debuginfo=n" to show source locations