Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/cargo/ops/cargo_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,13 @@ pub fn create_bcx<'a, 'cfg>(
extra_args = Some(args);
}

if let Some(args) = extra_args {
extra_compiler_args.insert(unit.clone(), args.clone());
if let Some(mut args) = extra_args {
match extra_compiler_args.get_mut(&unit) {
None => {
extra_compiler_args.insert(unit.clone(), args);
}
Some(existing) => existing.append(&mut args),
}
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions tests/testsuite/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ 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("--theme")
.arg("dark")
.with_stderr_contains("[RUNNING] `rustdoc [..] --theme dark[..]`")
.with_status(101)
.run();
}

#[cargo_test]
fn rustdoc_foo_with_bar_dependency() {
let foo = project()
Expand Down