about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-04-19 06:35:35 +0200
committerGitHub <noreply@github.com>2023-04-19 06:35:35 +0200
commitf20da94ccfc4b62a668dbaeb563e39452eb07a06 (patch)
tree7949389042528a6eafeb0064015b3ce8d3dc074d /src
parenta184557d1d3ae6d17a502b9b5c5994d968a47579 (diff)
parentc5e6ccb1ed0b1e8d4861d47d4728da4bda90efbd (diff)
downloadrust-f20da94ccfc4b62a668dbaeb563e39452eb07a06.tar.gz
rust-f20da94ccfc4b62a668dbaeb563e39452eb07a06.zip
Rollup merge of #110476 - compiler-errors:ty-err-ctxt-good-path, r=lcnr
Delay a good path bug on drop for `TypeErrCtxt` (instead of a regular delayed bug)

r? `@lcnr`
Perhaps we should just delete the `Drop` impl altogether though?

Fixes rust-lang/rust-clippy#10645

`@matthiaskrgr:` I don't know how to make a clippy test for this. Any idea? Clippy's UI tests run with `-D warnings` and I have no idea how to switch it off to make a test that triggers this ICE in the clippy test suite 🤣
Diffstat (limited to 'src')
-rw-r--r--src/tools/clippy/tests/ui/crashes/ice-5207.rs5
-rw-r--r--src/tools/clippy/tests/ui/crashes/ice-5207.stderr16
2 files changed, 20 insertions, 1 deletions
diff --git a/src/tools/clippy/tests/ui/crashes/ice-5207.rs b/src/tools/clippy/tests/ui/crashes/ice-5207.rs
index f463f78a99a..893c15f5d73 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 00000000000..367e9a08b75
--- /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
+