Skip to content

Commit

Permalink
chore: fix dead code warnings (#6423)
Browse files Browse the repository at this point in the history
  • Loading branch information
maminrayej authored Mar 22, 2024
1 parent d51f168 commit bb25a06
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions benches/sync_mpsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ 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])
}
}

#[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])
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/sync/tests/notify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn notify_waiters_handles_panicking_waker() {

let notify = Arc::new(Notify::new());

struct PanickingWaker(Arc<Notify>);
struct PanickingWaker(#[allow(dead_code)] Arc<Notify>);

impl ArcWake for PanickingWaker {
fn wake_by_ref(_arc_self: &Arc<Self>) {
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/sync/tests/semaphore_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ fn release_permits_at_drop() {

let sem = Arc::new(Semaphore::new(1));

struct ReleaseOnDrop(Option<OwnedSemaphorePermit>);
struct ReleaseOnDrop(#[allow(dead_code)] Option<OwnedSemaphorePermit>);

impl ArcWake for ReleaseOnDrop {
fn wake_by_ref(_arc_self: &Arc<Self>) {}
Expand Down
4 changes: 2 additions & 2 deletions tokio/src/util/markers.rs
Original file line number Diff line number Diff line change
@@ -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 ());
}

0 comments on commit bb25a06

Please sign in to comment.