diff --git a/tests/ui/async-await/gat-is-send-across-await.rs b/tests/ui/async-await/gat-is-send-across-await.rs new file mode 100644 index 0000000000000..43b777449edd0 --- /dev/null +++ b/tests/ui/async-await/gat-is-send-across-await.rs @@ -0,0 +1,23 @@ +//! Regression test for . + +//@ 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() { }