mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
10 lines
221 B
Rust
10 lines
221 B
Rust
fn main() {
|
|
let bar: fn(&mut u32) = |_| {};
|
|
|
|
fn foo(x: Box<dyn Fn(&i32)>) {}
|
|
let bar = Box::new(|x: &i32| {}) as Box<dyn Fn(_)>;
|
|
foo(bar);
|
|
//~^ ERROR mismatched types
|
|
//~| ERROR mismatched types
|
|
}
|