blob: e526cf0012d6f46ecb8ac068c9aa7d1cf761beee [file] [log] [blame] [edit]
//! Regression test for issue <https://github.com/rust-lang/rust/issues/51154>
//! Test that anonymous closure types cannot be coerced to a generic type
//! parameter (F: FnMut()) when trying to box them.
fn foo<F: FnMut()>() {
let _: Box<F> = Box::new(|| ());
//~^ ERROR mismatched types
}
fn main() {}