rust/tests/ui/impl-trait/opaque-cast-field-access-in-future.rs

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

28 lines
367 B
Rust
Raw Normal View History

// edition: 2021
use std::future::Future;
async fn bop() {
fold(run(), |mut foo| async move {
&mut foo.bar;
})
}
fn fold<Fut, F, U>(_: Foo<U>, f: F)
where
F: FnMut(Foo<U>) -> Fut,
{
loop {}
}
struct Foo<F> {
bar: Vec<F>,
}
fn run() -> Foo<impl Future<Output = ()>> {
//~^ ERROR type annotations needed
loop {}
}
fn main() {}