diff options
| author | Celina G. Val <celinval@amazon.com> | 2025-06-11 12:32:09 -0700 |
|---|---|---|
| committer | Celina G. Val <celinval@amazon.com> | 2025-06-11 16:56:01 -0700 |
| commit | f52c6eee02fb9a9cfe203ce95c4968c2835c034b (patch) | |
| tree | 93d6b6f10a357b37cd68911f6f4b049ccbec5fd8 /compiler/rustc_thread_pool/src/broadcast/mod.rs | |
| parent | 4aa62ea9e9015621969a0f505abf7a6894e99e9e (diff) | |
| download | rust-f52c6eee02fb9a9cfe203ce95c4968c2835c034b.tar.gz rust-f52c6eee02fb9a9cfe203ce95c4968c2835c034b.zip | |
Another round of tidy / warning fixes
Diffstat (limited to 'compiler/rustc_thread_pool/src/broadcast/mod.rs')
| -rw-r--r-- | compiler/rustc_thread_pool/src/broadcast/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_thread_pool/src/broadcast/mod.rs b/compiler/rustc_thread_pool/src/broadcast/mod.rs index c2b0d47f829..9545c4b15d8 100644 --- a/compiler/rustc_thread_pool/src/broadcast/mod.rs +++ b/compiler/rustc_thread_pool/src/broadcast/mod.rs @@ -6,7 +6,7 @@ use crate::job::{ArcJob, StackJob}; use crate::latch::{CountLatch, LatchRef}; use crate::registry::{Registry, WorkerThread}; -mod test; +mod tests; /// Executes `op` within every thread in the current threadpool. If this is /// called from a non-Rayon thread, it will execute in the global threadpool. @@ -103,18 +103,18 @@ where }; let n_threads = registry.num_threads(); - let current_thread = WorkerThread::current().as_ref(); + let current_thread = unsafe { WorkerThread::current().as_ref() }; let tlv = crate::tlv::get(); let latch = CountLatch::with_count(n_threads, current_thread); let jobs: Vec<_> = (0..n_threads).map(|_| StackJob::new(tlv, &f, LatchRef::new(&latch))).collect(); - let job_refs = jobs.iter().map(|job| job.as_job_ref()); + let job_refs = jobs.iter().map(|job| unsafe { job.as_job_ref() }); registry.inject_broadcast(job_refs); // Wait for all jobs to complete, then collect the results, maybe propagating a panic. latch.wait(current_thread); - jobs.into_iter().map(|job| job.into_result()).collect() + jobs.into_iter().map(|job| unsafe { job.into_result() }).collect() } /// Execute `op` on every thread in the pool. It will be executed on each |
