From bb25a06f348c8069308e6145623dd3743d87564d Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 22 Mar 2024 13:44:18 +0330 Subject: [PATCH] chore: fix dead code warnings (#6423) --- benches/sync_mpsc.rs | 4 ++-- tokio/src/sync/tests/notify.rs | 2 +- tokio/src/sync/tests/semaphore_batch.rs | 2 +- tokio/src/util/markers.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/benches/sync_mpsc.rs b/benches/sync_mpsc.rs index 117b3babdde..1a3f37cab81 100644 --- a/benches/sync_mpsc.rs +++ b/benches/sync_mpsc.rs @@ -4,7 +4,7 @@ use criterion::measurement::WallTime; use criterion::{black_box, criterion_group, criterion_main, BenchmarkGroup, Criterion}; #[derive(Debug, Copy, Clone)] -struct Medium([usize; 64]); +struct Medium(#[allow(dead_code)] [usize; 64]); impl Default for Medium { fn default() -> Self { Medium([0; 64]) @@ -12,7 +12,7 @@ impl Default for Medium { } #[derive(Debug, Copy, Clone)] -struct Large([Medium; 64]); +struct Large(#[allow(dead_code)] [Medium; 64]); impl Default for Large { fn default() -> Self { Large([Medium::default(); 64]) diff --git a/tokio/src/sync/tests/notify.rs b/tokio/src/sync/tests/notify.rs index 323b5c65ae3..83182464c50 100644 --- a/tokio/src/sync/tests/notify.rs +++ b/tokio/src/sync/tests/notify.rs @@ -52,7 +52,7 @@ fn notify_waiters_handles_panicking_waker() { let notify = Arc::new(Notify::new()); - struct PanickingWaker(Arc); + struct PanickingWaker(#[allow(dead_code)] Arc); impl ArcWake for PanickingWaker { fn wake_by_ref(_arc_self: &Arc) { diff --git a/tokio/src/sync/tests/semaphore_batch.rs b/tokio/src/sync/tests/semaphore_batch.rs index 09610ce71f2..fb5e8fdd6f7 100644 --- a/tokio/src/sync/tests/semaphore_batch.rs +++ b/tokio/src/sync/tests/semaphore_batch.rs @@ -268,7 +268,7 @@ fn release_permits_at_drop() { let sem = Arc::new(Semaphore::new(1)); - struct ReleaseOnDrop(Option); + struct ReleaseOnDrop(#[allow(dead_code)] Option); impl ArcWake for ReleaseOnDrop { fn wake_by_ref(_arc_self: &Arc) {} diff --git a/tokio/src/util/markers.rs b/tokio/src/util/markers.rs index 7031fb6bcd1..c16ebdf0bc6 100644 --- a/tokio/src/util/markers.rs +++ b/tokio/src/util/markers.rs @@ -1,8 +1,8 @@ /// Marker for types that are `Sync` but not `Send` -pub(crate) struct SyncNotSend(*mut ()); +pub(crate) struct SyncNotSend(#[allow(dead_code)] *mut ()); unsafe impl Sync for SyncNotSend {} cfg_rt! { - pub(crate) struct NotSendOrSync(*mut ()); + pub(crate) struct NotSendOrSync(#[allow(dead_code)] *mut ()); }