tests/ui/async-await/gat-is-send-across-await.rs: New regression test

The test began passing in `nightly-2025-10-16`. Probably by c50aebba78
because it fixed two "does not live long enough" errors. The test fails
to compile with `nightly-2025-10-15` with such an error:

    $ rustc +nightly-2025-10-15 --edition 2018 tests/ui/async-await/gat-is-send-across-await.rs
    error: `impl G` does not live long enough
      --> tests/ui/async-await/gat-is-send-across-await.rs:16:24
       |
    16 |       let _: &dyn Send = &async move {
       |  ________________________^
    17 | |         let _gat = g.as_gat();
    18 | |         async{}.await
    19 | |     };
       | |_____^
This commit is contained in:
Martin Nordholts
2026-03-21 16:00:51 +01:00
parent bfc05d6b07
commit aed54f219e
@@ -0,0 +1,23 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/111852>.
//@ edition:2018
//@ check-pass
#![allow(unused)]
trait G: Send {
type Gat<'l>: Send
where
Self: 'l;
fn as_gat(&self) -> Self::Gat<'_>;
}
fn a(g: impl G) {
let _: &dyn Send = &async move {
let _gat = g.as_gat();
async{}.await
};
}
fn main() { }