Rollup merge of #81675 - poliorcetics:respect-shortness, r=jyn514

Make rustdoc respect `--error-format short` in doctests

Note that this will not work with `cargo test`, only with `rustdoc --test`, I'll have to modify `cargo` as well.

Fix #81662.

`@rustbot` label +T-rustdoc +A-doctests
This commit is contained in:
Mara Bos 2021-02-06 00:14:14 +01:00 committed by GitHub
commit e8aaa1490f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 1 deletions

View file

@ -296,7 +296,12 @@ fn run_test(
}
});
if let ErrorOutputType::HumanReadable(kind) = options.error_format {
let (_, color_config) = kind.unzip();
let (short, color_config) = kind.unzip();
if short {
compiler.arg("--error-format").arg("short");
}
match color_config {
ColorConfig::Never => {
compiler.arg("--color").arg("never");