Skip to content

extern C functions need to be C-unwind in Rust 1.81.0 #584

Closed
@asomers

Description

@asomers

A recent change to rustc (rust-lang/rust#74990) changed the behavior of unwinding from a Rust function across an extern C ABI change. Now, that will cause an abort. This is causing Mockall's CI tests to fail. The possible solutions are either:

  • Require users to specify extern C-unwind instead. This is annoying for users, and it might not be correct for all non-mock functions.
  • Automatically define the mock functions as C-unwind. This is much better. However, it causes two new problems:
    • A function pointer to the original C function will now have a different type from a function pointer to the mock function, because the ABI is part of the function pointer's type.
    • C-unwind does not yet work for variadic functions.
  • Somehow figure out how to make Mockall work with panic=abort. It's not a problem, as long as no tests are should_panic and no tests ever fail 😉 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions