about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-04-18 18:15:06 +0200
committerMichael Goulet <michael@errs.io>2023-04-18 18:46:41 +0000
commit1dfc231b10baa850b072a6c5f3d845f2e0a19d07 (patch)
treee2db85ab55a2e419a37dc8ef8c1f8a7a14c13bd3
parent8f53926232c43aa9d03e88c24460411542a244ed (diff)
downloadrust-1dfc231b10baa850b072a6c5f3d845f2e0a19d07.tar.gz
rust-1dfc231b10baa850b072a6c5f3d845f2e0a19d07.zip
clippy: add test for https://github.com/rust-lang/rust-clippy/issues/10645
-rw-r--r--tests/ui/crashes/ice-5207.rs5
-rw-r--r--tests/ui/crashes/ice-5207.stderr16
2 files changed, 20 insertions, 1 deletions
diff --git a/tests/ui/crashes/ice-5207.rs b/tests/ui/crashes/ice-5207.rs
index f463f78a99a..893c15f5d73 100644
--- a/tests/ui/crashes/ice-5207.rs
+++ b/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/tests/ui/crashes/ice-5207.stderr b/tests/ui/crashes/ice-5207.stderr
new file mode 100644
index 00000000000..367e9a08b75
--- /dev/null
+++ b/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
+