Skip to content

Commit 393ff7e

Browse files
committed
Use the C-unwind ABI when mocking variadic functions
Now that rust-lang/rust#126836 is fixed.
1 parent bcb4a88 commit 393ff7e

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

mockall/tests/automock_foreign_c_variadic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn mocked_c_variadic() {
2929
#[test]
3030
#[cfg(feature = "nightly")]
3131
#[cfg_attr(miri, ignore)]
32-
#[ignore = "https://github.com/rust-lang/rust/issues/126836"]
32+
#[should_panic(expected = "No matching expectation found")]
3333
fn panics() {
3434
let _m = FOO_MTX.lock();
3535
unsafe{ mock_ffi::foo(1,2,3) };

mockall_derive/src/mock_item.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,9 @@ impl From<MockableModule> for MockItemModule {
9898
//
9999
// BUT, use C-unwind instead of C, so we can panic
100100
// from the mock function (rust-lang/rust #74990)
101-
//
102-
// BUT, don't use C-unwind for variadic functions,
103-
// because it doesn't work yet (rust-lang/rust
104-
// #126836)
105101
let needs_c_unwind = if let Some(n) = &ifm.abi.name
106102
{
107-
n.value() == "C" && f.sig.variadic.is_none()
103+
n.value() == "C"
108104
} else {
109105
false
110106
};

0 commit comments

Comments
 (0)