rust/tests/ui/issues/auxiliary/issue-111011.rs
John Bobbo 35985091cc
Fix suggestion for boxing an async closure body, and
also add a suggestion for boxing empty blocks.
2023-05-07 20:30:56 -07:00

13 lines
320 B
Rust

#![feature(async_closure)]
// edition:2021
fn foo<X>(x: impl FnOnce() -> Box<X>) {}
// just to make sure async closures can still be suggested for boxing.
fn bar<X>(x: Box<dyn FnOnce() -> X>) {}
fn main() {
foo(async move || {}); //~ ERROR mismatched types
bar(async move || {}); //~ ERROR mismatched types
}