From 0f10415fb3d4fbb8b025876d161da446011c3d21 Mon Sep 17 00:00:00 2001 From: claude-asm-audit Date: Sat, 12 Sep 2026 05:26:07 +0000 Subject: [PATCH] style: cargo fmt sweep under rustc 1.98.1 (toolchain reformat, no semantic change) Four files were already fmt-dirty on 8fd724a; the merge added none. --- benches/general.rs | 12 +++++++++--- benches/rq_runtime.rs | 9 ++++++++- src/runtime.rs | 15 ++++++++++++--- src/scheduler.rs | 9 +++------ 4 files changed, 32 insertions(+), 13 deletions(-) diff --git a/benches/general.rs b/benches/general.rs index 7b6187b..e81ba27 100644 --- a/benches/general.rs +++ b/benches/general.rs @@ -634,16 +634,22 @@ fn main() { run_n("tokio multi-thread", ITERS, bench_pp_tokio_multi); // ---- 5. spawn_pair_control ---- - print_header(&format!("spawn_pair_control: {PP_ROUNDS} rounds, no messages")); + print_header(&format!( + "spawn_pair_control: {PP_ROUNDS} rounds, no messages" + )); run_n("smarm 1-thread", ITERS, || bench_ctl_smarm(1)); run_n(&format!("smarm {n}-thread"), ITERS, || bench_ctl_smarm(n)); run_n("tokio current_thread", ITERS, bench_ctl_tokio_current); run_n("tokio multi-thread", ITERS, bench_ctl_tokio_multi); // ---- 6. ping_pong_steady ---- - print_header(&format!("ping_pong_steady: 1 pair × {PP_STEADY} roundtrips")); + print_header(&format!( + "ping_pong_steady: 1 pair × {PP_STEADY} roundtrips" + )); run_n("smarm 1-thread", ITERS, || bench_steady_smarm(1)); - run_n(&format!("smarm {n}-thread"), ITERS, || bench_steady_smarm(n)); + run_n(&format!("smarm {n}-thread"), ITERS, || { + bench_steady_smarm(n) + }); run_n("tokio current_thread", ITERS, bench_steady_tokio_current); run_n("tokio multi-thread", ITERS, bench_steady_tokio_multi); } diff --git a/benches/rq_runtime.rs b/benches/rq_runtime.rs index cc7fcbc..dae7f6b 100644 --- a/benches/rq_runtime.rs +++ b/benches/rq_runtime.rs @@ -257,7 +257,14 @@ fn main() { mid.us, per_s ); - println!("RQDIAG,{},{},{},{},{}", variant(), slot_str, name, t, mid.diag); + println!( + "RQDIAG,{},{},{},{},{}", + variant(), + slot_str, + name, + t, + mid.diag + ); if slot { println!( "RQSLOT,{},{},{},{},{}", diff --git a/src/runtime.rs b/src/runtime.rs index 6a470bd..e7dbed0 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -418,7 +418,9 @@ impl SchedulerStats { /// Bump a per-thread diagnostic counter on the calling scheduler thread. macro_rules! diag { ($inner:expr, $field:ident) => { - $inner.stats[sched_slot()].$field.fetch_add(1, Ordering::Relaxed) + $inner.stats[sched_slot()] + .$field + .fetch_add(1, Ordering::Relaxed) }; } @@ -480,7 +482,11 @@ impl RuntimeStats { /// (target 5 instrumentation). Reset at the start of each `run()`. pub fn wake_diag(&self) -> String { let sum = |f: fn(&SchedulerStats) -> &AtomicU64| -> u64 { - self.inner.stats.iter().map(|s| f(s).load(Ordering::Relaxed)).sum() + self.inner + .stats + .iter() + .map(|s| f(s).load(Ordering::Relaxed)) + .sum() }; format!( "slot_hits={} displaced={} unpark_slot={} unpark_queue={} unpark_notified={} \ @@ -1792,7 +1798,10 @@ pub(crate) fn install_actor( stack: crate::stack::Stack, supervisor: Pid, closure: Closure, - monitor: Option<(crate::monitor::MonitorId, crate::channel::Sender)>, + monitor: Option<( + crate::monitor::MonitorId, + crate::channel::Sender, + )>, ) -> Pid { let slot = &inner.slots[idx as usize]; let gen = slot.generation(); // stable: we own the vacant slot via the free list diff --git a/src/scheduler.rs b/src/scheduler.rs index 9946ec7..32850da 100644 --- a/src/scheduler.rs +++ b/src/scheduler.rs @@ -404,7 +404,8 @@ pub fn spawn_monitor_with( let (pid, id) = with_runtime(|inner| { let idx = inner.allocate_slot(); // panics loudly on slab exhaustion let id = inner.alloc_monitor_id(); - let pid = crate::runtime::install_actor(inner, idx, sp, stack, parent, closure, Some((id, tx))); + let pid = + crate::runtime::install_actor(inner, idx, sp, stack, parent, closure, Some((id, tx))); (pid, id) }); @@ -612,11 +613,7 @@ pub(crate) fn runtime_weak() -> Option> { // (preemption-gated, slot-eligible); off one that path is a silent no-op, so // we reach the runtime through `rt` — the `Weak` the waker captured while it // was in-runtime. Mirrors the IO backend's cross-context wake (io.rs, RFC 018). -pub(crate) fn unpark_at_via( - pid: Pid, - epoch: u32, - rt: impl FnOnce() -> Option>, -) { +pub(crate) fn unpark_at_via(pid: Pid, epoch: u32, rt: impl FnOnce() -> Option>) { if try_with_runtime(|inner| inner.unpark_at(pid, epoch)).is_some() { return; }