rust/src/test/ui/issues/issue-40000.rs
Niko Matsakis bc4404c0b5 improve handling for subtype
Still not great, but good enough to land this PR.
2019-01-02 17:35:06 -05:00

8 lines
165 B
Rust

fn main() {
let bar: fn(&mut u32) = |_| {};
fn foo(x: Box<Fn(&i32)>) {}
let bar = Box::new(|x: &i32| {}) as Box<Fn(_)>;
foo(bar); //~ ERROR E0308
}