Skip to content

Commit 53245a1

Browse files
committed
Set error handler output format as soon as possible
1 parent 5bd28f5 commit 53245a1

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

compiler/rustc_session/src/config.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2405,6 +2405,8 @@ pub fn build_session_options(
24052405

24062406
let error_format = parse_error_format(handler, matches, color, json_rendered);
24072407

2408+
handler.abort_if_error_and_set_error_format(error_format);
2409+
24082410
let diagnostic_width = matches.opt_get("diagnostic-width").unwrap_or_else(|_| {
24092411
handler.early_error("`--diagnostic-width` must be an positive integer");
24102412
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// check-pass
2+
// compile-flags: -Cremark=foo --error-format=human --color always
3+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
warning: -C remark requires "-C debuginfo=n" to show source locations
2+

0 commit comments

Comments
 (0)