mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
clippy: add test for https://github.com/rust-lang/rust-clippy/issues/10645
This commit is contained in:
parent
8f53926232
commit
1dfc231b10
2 changed files with 20 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
||||||
// Regression test for https://github.com/rust-lang/rust-clippy/issues/5207
|
// compile-flags: --cap-lints=warn
|
||||||
|
// ^ for https://github.com/rust-lang/rust-clippy/issues/10645
|
||||||
|
|
||||||
|
// Regression test for https://github.com/rust-lang/rust-clippy/issues/5207
|
||||||
|
#![warn(clippy::future_not_send)]
|
||||||
pub async fn bar<'a, T: 'a>(_: T) {}
|
pub async fn bar<'a, T: 'a>(_: T) {}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
16
tests/ui/crashes/ice-5207.stderr
Normal file
16
tests/ui/crashes/ice-5207.stderr
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
warning: future cannot be sent between threads safely
|
||||||
|
--> $DIR/ice-5207.rs:6:35
|
||||||
|
|
|
||||||
|
LL | pub async fn bar<'a, T: 'a>(_: T) {}
|
||||||
|
| ^ future returned by `bar` is not `Send`
|
||||||
|
|
|
||||||
|
note: captured value is not `Send`
|
||||||
|
--> $DIR/ice-5207.rs:6:29
|
||||||
|
|
|
||||||
|
LL | pub async fn bar<'a, T: 'a>(_: T) {}
|
||||||
|
| ^ has type `T` which is not `Send`
|
||||||
|
= note: `T` doesn't implement `std::marker::Send`
|
||||||
|
= note: `-D clippy::future-not-send` implied by `-D warnings`
|
||||||
|
|
||||||
|
warning: 1 warning emitted
|
||||||
|
|
Loading…
Reference in a new issue