mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
rustdoc rejects html emits with json output
This commit is contained in:
@@ -522,6 +522,18 @@ fn println_condition(condition: Condition) {
|
||||
}
|
||||
}
|
||||
|
||||
if output_format == OutputFormat::Json {
|
||||
if let Some(emit_flag) = emit.iter().find_map(|emit| match emit {
|
||||
EmitType::HtmlStaticFiles => Some("html-static-files"),
|
||||
EmitType::HtmlNonStaticFiles => Some("html-non-static-files"),
|
||||
EmitType::DepInfo(_) => None,
|
||||
}) {
|
||||
dcx.fatal(format!(
|
||||
"the `--emit={emit_flag}` flag is not supported with `--output-format=json`",
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
let to_check = matches.opt_strs("check-theme");
|
||||
if !to_check.is_empty() {
|
||||
let mut content =
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
error: the `--emit=html-non-static-files` flag is not supported with `--output-format=json`
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
error: the `--emit=html-static-files` flag is not supported with `--output-format=json`
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
//@ revisions: html_static html_non_static
|
||||
//@ check-fail
|
||||
//@[html_static] compile-flags: -Z unstable-options --output-format=json --emit=html-static-files
|
||||
//@[html_non_static] compile-flags: -Z unstable-options --output-format=json --emit=html-non-static-files
|
||||
//[html_static]~? ERROR the `--emit=html-static-files` flag is not supported with `--output-format=json`
|
||||
//[html_non_static]~? ERROR the `--emit=html-non-static-files` flag is not supported with `--output-format=json`
|
||||
|
||||
pub struct Foo;
|
||||
@@ -0,0 +1,5 @@
|
||||
//@ compile-flags: -Z unstable-options --show-coverage --output-format=json --emit=html-non-static-files
|
||||
//@ check-fail
|
||||
//~? ERROR the `--emit=html-non-static-files` flag is not supported with `--output-format=json`
|
||||
|
||||
pub struct Foo;
|
||||
@@ -0,0 +1,2 @@
|
||||
error: the `--emit=html-non-static-files` flag is not supported with `--output-format=json`
|
||||
|
||||
Reference in New Issue
Block a user