Skip to content

Can't mock universal types #67

@gregdhill

Description

@gregdhill

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions