From c5e6ccb1ed0b1e8d4861d47d4728da4bda90efbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Tue, 18 Apr 2023 18:15:06 +0200 Subject: [PATCH] clippy: add test for https://github.com/rust-lang/rust-clippy/issues/10645 --- src/tools/clippy/tests/ui/crashes/ice-5207.rs | 5 ++++- .../clippy/tests/ui/crashes/ice-5207.stderr | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/tools/clippy/tests/ui/crashes/ice-5207.stderr diff --git a/src/tools/clippy/tests/ui/crashes/ice-5207.rs b/src/tools/clippy/tests/ui/crashes/ice-5207.rs index f463f78a99ab7..893c15f5d731c 100644 --- a/src/tools/clippy/tests/ui/crashes/ice-5207.rs +++ b/src/tools/clippy/tests/ui/crashes/ice-5207.rs @@ -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) {} fn main() {} diff --git a/src/tools/clippy/tests/ui/crashes/ice-5207.stderr b/src/tools/clippy/tests/ui/crashes/ice-5207.stderr new file mode 100644 index 0000000000000..367e9a08b7563 --- /dev/null +++ b/src/tools/clippy/tests/ui/crashes/ice-5207.stderr @@ -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 +