From 4d841497da34dbe1c51071d38b5b1c440ae308b7 Mon Sep 17 00:00:00 2001 From: lcnr Date: Tue, 12 Aug 2025 17:04:10 +0200 Subject: [PATCH] add test --- ...sync-auto-trait-overflow-only-parent-args.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/ui/async-await/recursive-async-auto-trait-overflow-only-parent-args.rs diff --git a/tests/ui/async-await/recursive-async-auto-trait-overflow-only-parent-args.rs b/tests/ui/async-await/recursive-async-auto-trait-overflow-only-parent-args.rs new file mode 100644 index 00000000000..9681f66412a --- /dev/null +++ b/tests/ui/async-await/recursive-async-auto-trait-overflow-only-parent-args.rs @@ -0,0 +1,17 @@ +// Regression test for #145288. This is the same issue as #145151 +// which we fixed in #145194. However in that PR we accidentally created +// a `CoroutineWitness` which referenced all generic arguments of the +// coroutine, including upvars and the signature. + +//@ edition: 2024 +//@ check-pass + +async fn process<'a>(x: &'a u32) { + Box::pin(process(x)).await; +} + +fn require_send(_: impl Send) {} + +fn main() { + require_send(process(&1)); +}