rust/tests/crashes/131050.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
431 B
Rust
Raw Normal View History

2024-10-09 08:34:45 -05:00
//@ known-bug: #131050
//@ compile-flags: --edition=2021
2024-11-02 17:44:12 -05:00
use std::future::Future;
2024-10-09 08:34:45 -05:00
2024-11-02 17:44:12 -05:00
fn invalid_future() -> impl Future {}
2024-10-09 08:34:45 -05:00
2024-11-02 17:44:12 -05:00
fn create_complex_future() -> impl Future<Output = impl ReturnsSend> {
async { &|| async { invalid_future().await } }
2024-10-09 08:34:45 -05:00
}
2024-11-02 17:44:12 -05:00
fn coerce_impl_trait() -> impl Future<Output = impl Send> {
create_complex_future()
2024-10-09 08:34:45 -05:00
}
2024-11-02 17:44:12 -05:00
trait ReturnsSend {}
2024-10-09 08:34:45 -05:00
2024-11-02 17:44:12 -05:00
impl<F, R> ReturnsSend for F
2024-10-09 08:34:45 -05:00
where
F: Fn() -> R,
R: Send,
{
}