Mocktopus icon indicating copy to clipboard operation
Mocktopus copied to clipboard

Can't mock universal types

Open gregdhill opened this issue 3 years ago • 0 comments

Take the following example:

#[mockable]
fn call_with_closure(
    num: u32,
    math_op: impl FnOnce(u32) -> u32,
) -> u32 {
    math_op(num)
}

This fails with the following compilation error:

error[E0641]: cannot cast to a pointer of an unknown kind
  --> src/main.rs:21:10
   |
21 |   ) -> u32 {
   |  __________^
22 | |     math_op(num)
23 | | }
   | |_^ needs more type information

gregdhill avatar Apr 02 '21 12:04 gregdhill