Skip to content

Commit dd9e4ba

Browse files
committed
Hide unused_variables warning in consider-restricting.rs ui test
1 parent b454fc8 commit dd9e4ba

File tree

2 files changed

+16
-30
lines changed

2 files changed

+16
-30
lines changed

tests/ui/consider-restricting.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ struct Client;
1313

1414
#[async_trait]
1515
impl ClientExt for Client {
16-
async fn publish<T: IntoUrl>(&self, url: T) {}
16+
async fn publish<T: IntoUrl>(&self, _url: T) {}
1717
}
1818

1919
struct Client2;
2020

2121
#[async_trait]
2222
impl ClientExt for Client2 {
23-
async fn publish<T>(&self, url: T) {}
23+
async fn publish<T>(&self, _url: T) {}
2424
}
2525

2626
fn main() {}

tests/ui/consider-restricting.stderr

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,33 @@
1-
warning: unused variable: `url`
2-
--> tests/ui/consider-restricting.rs:16:41
3-
|
4-
16 | async fn publish<T: IntoUrl>(&self, url: T) {}
5-
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
6-
|
7-
= note: `#[warn(unused_variables)]` on by default
8-
91
error: future cannot be sent between threads safely
10-
--> tests/ui/consider-restricting.rs:16:49
2+
--> tests/ui/consider-restricting.rs:16:50
113
|
12-
16 | async fn publish<T: IntoUrl>(&self, url: T) {}
13-
| ^^ future created by async block is not `Send`
4+
16 | async fn publish<T: IntoUrl>(&self, _url: T) {}
5+
| ^^ future created by async block is not `Send`
146
|
157
note: captured value is not `Send`
168
--> tests/ui/consider-restricting.rs:16:41
179
|
18-
16 | async fn publish<T: IntoUrl>(&self, url: T) {}
19-
| ^^^ has type `T` which is not `Send`
20-
= note: required for the cast from `Pin<Box<{async block@$DIR/tests/ui/consider-restricting.rs:16:49: 16:51}>>` to `Pin<Box<dyn Future<Output = ()> + Send>>`
10+
16 | async fn publish<T: IntoUrl>(&self, _url: T) {}
11+
| ^^^^ has type `T` which is not `Send`
12+
= note: required for the cast from `Pin<Box<{async block@$DIR/tests/ui/consider-restricting.rs:16:50: 16:52}>>` to `Pin<Box<dyn Future<Output = ()> + Send>>`
2113
help: consider further restricting type parameter `T` with trait `Send`
2214
|
23-
16 | async fn publish<T: IntoUrl + std::marker::Send>(&self, url: T) {}
15+
16 | async fn publish<T: IntoUrl + std::marker::Send>(&self, _url: T) {}
2416
| +++++++++++++++++++
2517

26-
warning: unused variable: `url`
27-
--> tests/ui/consider-restricting.rs:23:32
28-
|
29-
23 | async fn publish<T>(&self, url: T) {}
30-
| ^^^ help: if this is intentional, prefix it with an underscore: `_url`
31-
3218
error: future cannot be sent between threads safely
33-
--> tests/ui/consider-restricting.rs:23:40
19+
--> tests/ui/consider-restricting.rs:23:41
3420
|
35-
23 | async fn publish<T>(&self, url: T) {}
36-
| ^^ future created by async block is not `Send`
21+
23 | async fn publish<T>(&self, _url: T) {}
22+
| ^^ future created by async block is not `Send`
3723
|
3824
note: captured value is not `Send`
3925
--> tests/ui/consider-restricting.rs:23:32
4026
|
41-
23 | async fn publish<T>(&self, url: T) {}
42-
| ^^^ has type `T` which is not `Send`
43-
= note: required for the cast from `Pin<Box<{async block@$DIR/tests/ui/consider-restricting.rs:23:40: 23:42}>>` to `Pin<Box<dyn Future<Output = ()> + Send>>`
27+
23 | async fn publish<T>(&self, _url: T) {}
28+
| ^^^^ has type `T` which is not `Send`
29+
= note: required for the cast from `Pin<Box<{async block@$DIR/tests/ui/consider-restricting.rs:23:41: 23:43}>>` to `Pin<Box<dyn Future<Output = ()> + Send>>`
4430
help: consider further restricting type parameter `T` with trait `Send`
4531
|
46-
23 | async fn publish<T + std::marker::Send>(&self, url: T) {}
32+
23 | async fn publish<T + std::marker::Send>(&self, _url: T) {}
4733
| +++++++++++++++++++

0 commit comments

Comments
 (0)