@@ -404,8 +404,11 @@ fn main_args(args: &[String]) -> isize {
404
404
`short` (instead was `{}`)", arg) ) ;
405
405
}
406
406
} ;
407
+ let treat_err_as_bug = matches. opt_strs ( "Z" ) . iter ( ) . any ( |x| {
408
+ * x == "treat-err-as-bug"
409
+ } ) ;
407
410
408
- let diag = core:: new_handler ( error_format, None ) ;
411
+ let diag = core:: new_handler ( error_format, None , treat_err_as_bug ) ;
409
412
410
413
// check for deprecated options
411
414
check_deprecated_options ( & matches, & diag) ;
@@ -560,7 +563,7 @@ fn main_args(args: &[String]) -> isize {
560
563
let res = acquire_input ( PathBuf :: from ( input) , externs, edition, cg, & matches, error_format,
561
564
move |out| {
562
565
let Output { krate, passes, renderinfo } = out;
563
- let diag = core:: new_handler ( error_format, None ) ;
566
+ let diag = core:: new_handler ( error_format, None , treat_err_as_bug ) ;
564
567
info ! ( "going to format" ) ;
565
568
match output_format. as_ref ( ) . map ( |s| & * * s) {
566
569
Some ( "html" ) | None => {
@@ -694,6 +697,9 @@ where R: 'static + Send,
694
697
let force_unstable_if_unmarked = matches. opt_strs ( "Z" ) . iter ( ) . any ( |x| {
695
698
* x == "force-unstable-if-unmarked"
696
699
} ) ;
700
+ let treat_err_as_bug = matches. opt_strs ( "Z" ) . iter ( ) . any ( |x| {
701
+ * x == "treat-err-as-bug"
702
+ } ) ;
697
703
698
704
let ( lint_opts, describe_lints, lint_cap) = get_cmd_lint_options ( matches, error_format) ;
699
705
@@ -706,7 +712,8 @@ where R: 'static + Send,
706
712
core:: run_core ( paths, cfgs, externs, Input :: File ( cratefile) , triple, maybe_sysroot,
707
713
display_warnings, crate_name. clone ( ) ,
708
714
force_unstable_if_unmarked, edition, cg, error_format,
709
- lint_opts, lint_cap, describe_lints, manual_passes, default_passes) ;
715
+ lint_opts, lint_cap, describe_lints, manual_passes, default_passes,
716
+ treat_err_as_bug) ;
710
717
711
718
info ! ( "finished with rustc" ) ;
712
719
0 commit comments