Make doctests collect and emit the unused externs

This commit is contained in:
est31 2020-08-01 12:57:35 +02:00
parent 2d5200605f
commit 13371b59ee
3 changed files with 88 additions and 7 deletions

View file

@ -153,6 +153,8 @@ crate struct Options {
/// If this option is set to `true`, rustdoc will only run checks and not generate
/// documentation.
crate run_check: bool,
/// Whether doctests should emit unused externs
crate json_unused_externs: bool,
}
impl fmt::Debug for Options {
@ -323,7 +325,8 @@ impl Options {
}
let color = config::parse_color(&matches);
let config::JsonConfig { json_rendered, .. } = config::parse_json(&matches);
let config::JsonConfig { json_rendered, json_unused_externs, .. } =
config::parse_json(&matches);
let error_format = config::parse_error_format(&matches, color, json_rendered);
let codegen_options = build_codegen_options(matches, error_format);
@ -644,6 +647,7 @@ impl Options {
},
crate_name,
output_format,
json_unused_externs,
})
}