Auto merge of #8449 - jyn514:rustdoc, r=ehuss

Don't overwrite existing `rustdoc` args with --document-private-items

Instead, add that flag in addition to any existing flags.

Closes https://github.com/rust-lang/cargo/issues/8445
This commit is contained in:
bors 2020-07-06 14:50:12 +00:00
commit c95c0b1c53
2 changed files with 15 additions and 1 deletions

View File

@ -476,7 +476,10 @@ pub fn create_bcx<'a, 'cfg>(
}
if let Some(args) = extra_args {
extra_compiler_args.insert(unit.clone(), args.clone());
extra_compiler_args
.entry(unit.clone())
.or_default()
.extend(args);
}
}
}

View File

@ -39,6 +39,17 @@ fn rustdoc_args() {
.run();
}
#[cargo_test]
fn rustdoc_binary_args_passed() {
let p = project().file("src/main.rs", "").build();
p.cargo("rustdoc -v")
.arg("--")
.arg("--markdown-no-toc")
.with_stderr_contains("[RUNNING] `rustdoc [..] --markdown-no-toc[..]`")
.run();
}
#[cargo_test]
fn rustdoc_foo_with_bar_dependency() {
let foo = project()