rust/tests/ui/suggestions/suggest-boxed-empty-block.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
219 B
Rust

#![feature(async_closure)]
// edition:2021
// run-rustfix
fn foo<T>(_: Box<T>) {}
fn bar<T>(_: impl Fn() -> Box<T>) {}
fn main() {
foo({}); //~ ERROR mismatched types
bar(|| {}); //~ ERROR mismatched types
}