Skip to content

Commit 3488f46

Browse files
committed
Ignore dead_code lint on Assert* traits
``` warning: trait `AssertSync` is never used --> futures-core/src/task/__internal/atomic_waker.rs:209:15 | 209 | trait AssertSync: Sync {} | ^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: trait `AssertKinds` is never used --> futures-channel/src/mpsc/mod.rs:130:7 | 130 | trait AssertKinds: Send + Sync + Clone {} | ^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: trait `AssertSendSync` is never used --> futures-executor/src/thread_pool.rs:48:7 | 48 | trait AssertSendSync: Send + Sync {} | ^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: trait `AssertSend` is never used --> futures-channel/tests/mpsc.rs:13:7 | 13 | trait AssertSend: Send {} | ^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default ```
1 parent 79785ec commit 3488f46

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

futures-channel/src/mpsc/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ pub struct Sender<T>(Option<BoundedSenderInner<T>>);
127127
/// This value is created by the [`unbounded`] function.
128128
pub struct UnboundedSender<T>(Option<UnboundedSenderInner<T>>);
129129

130+
#[allow(dead_code)]
130131
trait AssertKinds: Send + Sync + Clone {}
131132
impl AssertKinds for UnboundedSender<u32> {}
132133

futures-channel/tests/mpsc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use std::sync::atomic::{AtomicUsize, Ordering};
1010
use std::sync::{Arc, Mutex};
1111
use std::thread;
1212

13+
#[allow(dead_code)]
1314
trait AssertSend: Send {}
1415
impl AssertSend for mpsc::Sender<i32> {}
1516
impl AssertSend for mpsc::Receiver<i32> {}

futures-core/src/task/__internal/atomic_waker.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ impl AtomicWaker {
206206
/// Create an `AtomicWaker`.
207207
pub const fn new() -> Self {
208208
// Make sure that task is Sync
209+
#[allow(dead_code)]
209210
trait AssertSync: Sync {}
210211
impl AssertSync for Waker {}
211212

futures-executor/src/thread_pool.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pub struct ThreadPoolBuilder {
4545
before_stop: Option<Arc<dyn Fn(usize) + Send + Sync>>,
4646
}
4747

48+
#[allow(dead_code)]
4849
trait AssertSendSync: Send + Sync {}
4950
impl AssertSendSync for ThreadPool {}
5051

0 commit comments

Comments
 (0)