Skip to content

Commit 3ee8999

Browse files
authored
Ignore clippy::extra_unused_type_parameters lint (#2707)
1 parent aa1f5c7 commit 3ee8999

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

futures-test/src/assert_unmoved.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ impl<T> PinnedDrop for AssertUnmoved<T> {
175175

176176
#[cfg(test)]
177177
mod tests {
178+
#![allow(clippy::extra_unused_type_parameters)] // https://github.com/rust-lang/rust-clippy/issues/10319
179+
178180
use futures_core::future::Future;
179181
use futures_core::task::{Context, Poll};
180182
use futures_util::future::pending;
@@ -183,6 +185,7 @@ mod tests {
183185

184186
use super::AssertUnmoved;
185187

188+
// TODO: move this to futures/tests/auto_traits.rs
186189
#[test]
187190
fn assert_send_sync() {
188191
fn assert<T: Send + Sync>() {}

futures/tests/auto_traits.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![cfg(feature = "compat")]
2+
#![allow(clippy::extra_unused_type_parameters)] // https://github.com/rust-lang/rust-clippy/issues/10318
23

34
//! Assert Send/Sync/Unpin for all public types.
45

futures/tests/object_safety.rs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,51 @@
1-
fn assert_is_object_safe<T>() {}
1+
#![allow(clippy::extra_unused_type_parameters)] // https://github.com/rust-lang/rust-clippy/issues/10319
2+
3+
fn assert_is_object_safe<T: ?Sized>() {}
24

35
#[test]
46
fn future() {
57
// `FutureExt`, `TryFutureExt` and `UnsafeFutureObj` are not object safe.
68
use futures::future::{FusedFuture, Future, TryFuture};
79

8-
assert_is_object_safe::<&dyn Future<Output = ()>>();
9-
assert_is_object_safe::<&dyn FusedFuture<Output = ()>>();
10-
assert_is_object_safe::<&dyn TryFuture<Ok = (), Error = (), Output = Result<(), ()>>>();
10+
assert_is_object_safe::<dyn Future<Output = ()>>();
11+
assert_is_object_safe::<dyn FusedFuture<Output = ()>>();
12+
assert_is_object_safe::<dyn TryFuture<Ok = (), Error = (), Output = Result<(), ()>>>();
1113
}
1214

1315
#[test]
1416
fn stream() {
1517
// `StreamExt` and `TryStreamExt` are not object safe.
1618
use futures::stream::{FusedStream, Stream, TryStream};
1719

18-
assert_is_object_safe::<&dyn Stream<Item = ()>>();
19-
assert_is_object_safe::<&dyn FusedStream<Item = ()>>();
20-
assert_is_object_safe::<&dyn TryStream<Ok = (), Error = (), Item = Result<(), ()>>>();
20+
assert_is_object_safe::<dyn Stream<Item = ()>>();
21+
assert_is_object_safe::<dyn FusedStream<Item = ()>>();
22+
assert_is_object_safe::<dyn TryStream<Ok = (), Error = (), Item = Result<(), ()>>>();
2123
}
2224

2325
#[test]
2426
fn sink() {
2527
// `SinkExt` is not object safe.
2628
use futures::sink::Sink;
2729

28-
assert_is_object_safe::<&dyn Sink<(), Error = ()>>();
30+
assert_is_object_safe::<dyn Sink<(), Error = ()>>();
2931
}
3032

3133
#[test]
3234
fn io() {
3335
// `AsyncReadExt`, `AsyncWriteExt`, `AsyncSeekExt` and `AsyncBufReadExt` are not object safe.
3436
use futures::io::{AsyncBufRead, AsyncRead, AsyncSeek, AsyncWrite};
3537

36-
assert_is_object_safe::<&dyn AsyncRead>();
37-
assert_is_object_safe::<&dyn AsyncWrite>();
38-
assert_is_object_safe::<&dyn AsyncSeek>();
39-
assert_is_object_safe::<&dyn AsyncBufRead>();
38+
assert_is_object_safe::<dyn AsyncRead>();
39+
assert_is_object_safe::<dyn AsyncWrite>();
40+
assert_is_object_safe::<dyn AsyncSeek>();
41+
assert_is_object_safe::<dyn AsyncBufRead>();
4042
}
4143

4244
#[test]
4345
fn task() {
4446
// `ArcWake`, `SpawnExt` and `LocalSpawnExt` are not object safe.
4547
use futures::task::{LocalSpawn, Spawn};
4648

47-
assert_is_object_safe::<&dyn Spawn>();
48-
assert_is_object_safe::<&dyn LocalSpawn>();
49+
assert_is_object_safe::<dyn Spawn>();
50+
assert_is_object_safe::<dyn LocalSpawn>();
4951
}

0 commit comments

Comments
 (0)