Skip to content

Commit

Permalink
Auto merge of #8449 - jyn514:rustdoc, r=ehuss
Browse files Browse the repository at this point in the history
Don't overwrite existing `rustdoc` args with --document-private-items

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

Closes #8445
  • Loading branch information
bors committed Jul 6, 2020
2 parents 299514d + 1d1b344 commit c95c0b1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cargo/ops/cargo_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions tests/testsuite/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit c95c0b1

Please sign in to comment.