about summary refs log tree commit diff
path: root/compiler/rustc_thread_pool/src/spawn/mod.rs
diff options
context:
space:
mode:
authorCelina G. Val <celinval@amazon.com>2025-06-11 11:12:32 -0700
committerCelina G. Val <celinval@amazon.com>2025-06-11 11:12:32 -0700
commit0b9b1df0064396708a5e5ca27fd010ae3ad3a305 (patch)
treec854a9e2fd775dba7f0a5e70a2c7be121b5fec0b /compiler/rustc_thread_pool/src/spawn/mod.rs
parent35c5144394c1b93784867d330f694fa7c8f480e3 (diff)
downloadrust-0b9b1df0064396708a5e5ca27fd010ae3ad3a305.tar.gz
rust-0b9b1df0064396708a5e5ca27fd010ae3ad3a305.zip
Fix format and tidy for code moved from rayon
Diffstat (limited to 'compiler/rustc_thread_pool/src/spawn/mod.rs')
-rw-r--r--compiler/rustc_thread_pool/src/spawn/mod.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/compiler/rustc_thread_pool/src/spawn/mod.rs b/compiler/rustc_thread_pool/src/spawn/mod.rs
index 034df30dcfb..f1679a98234 100644
--- a/compiler/rustc_thread_pool/src/spawn/mod.rs
+++ b/compiler/rustc_thread_pool/src/spawn/mod.rs
@@ -1,9 +1,10 @@
+use std::mem;
+use std::sync::Arc;
+
 use crate::job::*;
 use crate::registry::Registry;
 use crate::tlv::Tlv;
 use crate::unwind;
-use std::mem;
-use std::sync::Arc;
 
 /// Puts the task into the Rayon threadpool's job queue in the "static"
 /// or "global" scope. Just like a standard thread, this task is not
@@ -28,9 +29,9 @@ use std::sync::Arc;
 /// other threads may steal tasks at any time. However, they are
 /// generally prioritized in a LIFO order on the thread from which
 /// they were spawned. Other threads always steal from the other end of
-/// the deque, like FIFO order.  The idea is that "recent" tasks are
+/// the deque, like FIFO order. The idea is that "recent" tasks are
 /// most likely to be fresh in the local CPU's cache, while other
-/// threads can steal older "stale" tasks.  For an alternate approach,
+/// threads can steal older "stale" tasks. For an alternate approach,
 /// consider [`spawn_fifo()`] instead.
 ///
 /// [`spawn_fifo()`]: fn.spawn_fifo.html
@@ -39,7 +40,7 @@ use std::sync::Arc;
 ///
 /// If this closure should panic, the resulting panic will be
 /// propagated to the panic handler registered in the `ThreadPoolBuilder`,
-/// if any.  See [`ThreadPoolBuilder::panic_handler()`][ph] for more
+/// if any. See [`ThreadPoolBuilder::panic_handler()`][ph] for more
 /// details.
 ///
 /// [ph]: struct.ThreadPoolBuilder.html#method.panic_handler
@@ -103,7 +104,7 @@ where
 }
 
 /// Fires off a task into the Rayon threadpool in the "static" or
-/// "global" scope.  Just like a standard thread, this task is not
+/// "global" scope. Just like a standard thread, this task is not
 /// tied to the current stack frame, and hence it cannot hold any
 /// references other than those with `'static` lifetime. If you want
 /// to spawn a task that references stack data, use [the `scope_fifo()`
@@ -124,7 +125,7 @@ where
 ///
 /// If this closure should panic, the resulting panic will be
 /// propagated to the panic handler registered in the `ThreadPoolBuilder`,
-/// if any.  See [`ThreadPoolBuilder::panic_handler()`][ph] for more
+/// if any. See [`ThreadPoolBuilder::panic_handler()`][ph] for more
 /// details.
 ///
 /// [ph]: struct.ThreadPoolBuilder.html#method.panic_handler
@@ -152,7 +153,7 @@ where
     let job_ref = spawn_job(func, registry);
 
     // If we're in the pool, use our thread's private fifo for this thread to execute
-    // in a locally-FIFO order.  Otherwise, just use the pool's global injector.
+    // in a locally-FIFO order. Otherwise, just use the pool's global injector.
     match registry.current_thread() {
         Some(worker) => worker.push_fifo(job_ref),
         None => registry.inject(job_ref),