Skip to content

Commit caadd7d

Browse files
Correctly handle --nocapture option for rustdoc
1 parent 54bc19e commit caadd7d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/cargo/ops/cargo_test.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,15 @@ fn run_doc_tests(
233233
}
234234

235235
for arg in test_args {
236-
p.arg("--test-args").arg(arg);
236+
// We special-case "--nocapture" because rustdoc needs to handle it directly.
237+
if *arg == "--nocapture" {
238+
// FIXME(GuillaumeGomez): remove the `unstable-options` once rustdoc stabilizes the
239+
// `--nocapture` option.
240+
p.arg("-Z").arg("unstable-options");
241+
p.arg(arg);
242+
} else {
243+
p.arg("--test-args").arg(arg);
244+
}
237245
}
238246

239247
p.args(args);

0 commit comments

Comments
 (0)