Skip to content

Commit

Permalink
rustdoc: Suppress warnings/errors with --test
Browse files Browse the repository at this point in the history
Threads spawned by the test framework have their output captured by default, so
for `rustdoc --test` threads this propagates that capturing to the spawned
thread that we now have.

Closes #39327
  • Loading branch information
alexcrichton committed Jan 27, 2017
1 parent 1283c02 commit e2ef630
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustdoc/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,12 @@ impl Collector {
should_panic: testing::ShouldPanic::No,
},
testfn: testing::DynTestFn(box move |()| {
let panic = io::set_panic(None);
let print = io::set_print(None);
match {
rustc_driver::in_rustc_thread(move || {
io::set_panic(panic);
io::set_print(print);
runtest(&test,
&cratename,
cfgs,
Expand Down

0 comments on commit e2ef630

Please sign in to comment.