about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/util.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-10-27 11:43:18 +0000
committerbors <bors@rust-lang.org>2020-10-27 11:43:18 +0000
commit56d288fa46e04cd5faf53d369a1a640a97e2bb08 (patch)
treec2f7e816a443a91a45a9038ce7ecc46ede60f97c /compiler/rustc_interface/src/util.rs
parent20b1e05a8d0e1773dc840a3286aa37916e87d84b (diff)
parent7c4fe002131f1160f2054885ab40c74464951a64 (diff)
downloadrust-56d288fa46e04cd5faf53d369a1a640a97e2bb08.tar.gz
rust-56d288fa46e04cd5faf53d369a1a640a97e2bb08.zip
Auto merge of #78227 - SergioBenitez:test-stdout-threading, r=m-ou-se
Capture output from threads spawned in tests

This is revival of #75172.

Original text:
> Fixes #42474.
>
> r? `@​dtolnay` since you expressed interest in this, but feel free to redirect if you aren't the right person anymore.

---

Closes #75172.
Diffstat (limited to 'compiler/rustc_interface/src/util.rs')
-rw-r--r--compiler/rustc_interface/src/util.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/util.rs b/compiler/rustc_interface/src/util.rs
index 7658ffb0e3d..46a6c5861d5 100644
--- a/compiler/rustc_interface/src/util.rs
+++ b/compiler/rustc_interface/src/util.rs
@@ -115,6 +115,11 @@ impl Write for Sink {
         Ok(())
     }
 }
+impl io::LocalOutput for Sink {
+    fn clone_box(&self) -> Box<dyn io::LocalOutput> {
+        Box::new(Self(self.0.clone()))
+    }
+}
 
 /// Like a `thread::Builder::spawn` followed by a `join()`, but avoids the need
 /// for `'static` bounds.