1
Fork 0

Rollup merge of #54205 - GuillaumeGomez:treat-err-as-bug, r=QuietMisdreavus

Add treat-err-as-bug flag in rustdoc

cc @nikomatsakis
r? @QuietMisdreavus
This commit is contained in:
Guillaume Gomez 2018-09-18 10:21:36 +02:00 committed by GitHub
commit 108be3cd6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 11 deletions

View file

@ -404,8 +404,11 @@ fn main_args(args: &[String]) -> isize {
`short` (instead was `{}`)", arg));
}
};
let treat_err_as_bug = matches.opt_strs("Z").iter().any(|x| {
*x == "treat-err-as-bug"
});
let diag = core::new_handler(error_format, None);
let diag = core::new_handler(error_format, None, treat_err_as_bug);
// check for deprecated options
check_deprecated_options(&matches, &diag);
@ -560,7 +563,7 @@ fn main_args(args: &[String]) -> isize {
let res = acquire_input(PathBuf::from(input), externs, edition, cg, &matches, error_format,
move |out| {
let Output { krate, passes, renderinfo } = out;
let diag = core::new_handler(error_format, None);
let diag = core::new_handler(error_format, None, treat_err_as_bug);
info!("going to format");
match output_format.as_ref().map(|s| &**s) {
Some("html") | None => {
@ -694,6 +697,9 @@ where R: 'static + Send,
let force_unstable_if_unmarked = matches.opt_strs("Z").iter().any(|x| {
*x == "force-unstable-if-unmarked"
});
let treat_err_as_bug = matches.opt_strs("Z").iter().any(|x| {
*x == "treat-err-as-bug"
});
let (lint_opts, describe_lints, lint_cap) = get_cmd_lint_options(matches, error_format);
@ -706,7 +712,8 @@ where R: 'static + Send,
core::run_core(paths, cfgs, externs, Input::File(cratefile), triple, maybe_sysroot,
display_warnings, crate_name.clone(),
force_unstable_if_unmarked, edition, cg, error_format,
lint_opts, lint_cap, describe_lints, manual_passes, default_passes);
lint_opts, lint_cap, describe_lints, manual_passes, default_passes,
treat_err_as_bug);
info!("finished with rustc");