Skip to content

Commit 1dfc231

Browse files
matthiaskrgrcompiler-errors
authored andcommitted
clippy: add test for rust-lang/rust-clippy#10645
1 parent 8f53926 commit 1dfc231

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

tests/ui/crashes/ice-5207.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
// Regression test for https://github.com/rust-lang/rust-clippy/issues/5207
1+
// compile-flags: --cap-lints=warn
2+
// ^ for https://github.com/rust-lang/rust-clippy/issues/10645
23

4+
// Regression test for https://github.com/rust-lang/rust-clippy/issues/5207
5+
#![warn(clippy::future_not_send)]
36
pub async fn bar<'a, T: 'a>(_: T) {}
47

58
fn main() {}

tests/ui/crashes/ice-5207.stderr

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
warning: future cannot be sent between threads safely
2+
--> $DIR/ice-5207.rs:6:35
3+
|
4+
LL | pub async fn bar<'a, T: 'a>(_: T) {}
5+
| ^ future returned by `bar` is not `Send`
6+
|
7+
note: captured value is not `Send`
8+
--> $DIR/ice-5207.rs:6:29
9+
|
10+
LL | pub async fn bar<'a, T: 'a>(_: T) {}
11+
| ^ has type `T` which is not `Send`
12+
= note: `T` doesn't implement `std::marker::Send`
13+
= note: `-D clippy::future-not-send` implied by `-D warnings`
14+
15+
warning: 1 warning emitted
16+

0 commit comments

Comments
 (0)