mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
24 lines
431 B
Rust
24 lines
431 B
Rust
//@ known-bug: #131050
|
|
//@ compile-flags: --edition=2021
|
|
|
|
use std::future::Future;
|
|
|
|
fn invalid_future() -> impl Future {}
|
|
|
|
fn create_complex_future() -> impl Future<Output = impl ReturnsSend> {
|
|
async { &|| async { invalid_future().await } }
|
|
}
|
|
|
|
fn coerce_impl_trait() -> impl Future<Output = impl Send> {
|
|
create_complex_future()
|
|
}
|
|
|
|
trait ReturnsSend {}
|
|
|
|
impl<F, R> ReturnsSend for F
|
|
where
|
|
F: Fn() -> R,
|
|
R: Send,
|
|
{
|
|
}
|