mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
35985091cc
also add a suggestion for boxing empty blocks.
13 lines
239 B
Rust
13 lines
239 B
Rust
#![feature(async_closure)]
|
|
|
|
// edition:2021
|
|
// run-rustfix
|
|
|
|
fn foo<T>(_: Box<T>) {}
|
|
fn bar<T>(_: impl Fn() -> Box<T>) {}
|
|
|
|
fn main() {
|
|
foo(Box::new(())); //~ ERROR mismatched types
|
|
bar(|| Box::new(())); //~ ERROR mismatched types
|
|
}
|