Skip to content

Commit bb25515

Browse files
committed
Add workaround for extern "C-unwind" not implementing common traits
1 parent fa3fd4c commit bb25515

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

objc-sys/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ macro_rules! generate_linking_tests {
7171
// Get function pointer to make the linker require the
7272
// symbol to be available.
7373
let f: unsafe extern $abi fn($($t),*) $(-> $r)? = crate::$name;
74+
// Workaround for https://github.com/rust-lang/rust/pull/92964
75+
#[cfg(feature = "unstable-c-unwind")]
76+
#[allow(clippy::useless_transmute)]
77+
let f: unsafe extern "C" fn() = unsafe { core::mem::transmute(f) };
7478
// Execute side-effect to ensure it is not optimized away.
7579
std::println!("{:p}", f);
7680
}

0 commit comments

Comments
 (0)