diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2020-07-07 13:10:19 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2020-07-10 11:53:26 +1000 |
| commit | 1e8ec2db1d3d695958a8040fbb3491a4378ef7ae (patch) | |
| tree | 4c31bdfc360c6b0b913b9d97d82852f9baad6d88 | |
| parent | 0a7d2970e5947e7a2940a32e6975817a389b0708 (diff) | |
| download | rust-1e8ec2db1d3d695958a8040fbb3491a4378ef7ae.tar.gz rust-1e8ec2db1d3d695958a8040fbb3491a4378ef7ae.zip | |
Add an explanatory comment to `scoped_thread`.
| -rw-r--r-- | src/librustc_interface/util.rs | 2 |
1 files changed, 2 insertions, 0 deletions
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<F: FnOnce() -> R + Send, R: Send>(cfg: thread::Builder, f: F) -> R { struct Ptr(*mut ()); |
