We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 827651f + 892f176 commit 2ca292bCopy full SHA for 2ca292b
2 files changed
compiler/rustc_thread_pool/src/latch.rs
@@ -220,7 +220,7 @@ pub(super) struct LockLatch {
220
221
impl LockLatch {
222
#[inline]
223
- pub(super) fn new() -> LockLatch {
+ pub(super) const fn new() -> LockLatch {
224
LockLatch { m: Mutex::new(false), v: Condvar::new() }
225
}
226
compiler/rustc_thread_pool/src/registry.rs
@@ -524,7 +524,7 @@ impl Registry {
524
OP: FnOnce(&WorkerThread, bool) -> R + Send,
525
R: Send,
526
{
527
- thread_local!(static LOCK_LATCH: LockLatch = LockLatch::new());
+ thread_local!(static LOCK_LATCH: LockLatch = const { LockLatch::new() });
528
529
LOCK_LATCH.with(|l| {
530
// This thread isn't a member of *any* thread pool, so just block.
0 commit comments