From 1e8ec2db1d3d695958a8040fbb3491a4378ef7ae Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 7 Jul 2020 13:10:19 +1000 Subject: [PATCH] Add an explanatory comment to `scoped_thread`. --- src/librustc_interface/util.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/librustc_interface/util.rs b/src/librustc_interface/util.rs index fe091e92062..438b72b0b61 100644 --- a/src/librustc_interface/util.rs +++ b/src/librustc_interface/util.rs @@ -102,6 +102,8 @@ impl Write for Sink { } } +/// Like a `thread::Builder::spawn` followed by a `join()`, but avoids the need +/// for `'static` bounds. #[cfg(not(parallel_compiler))] pub fn scoped_thread R + Send, R: Send>(cfg: thread::Builder, f: F) -> R { struct Ptr(*mut ());