Skip to content

Commit 0067ae3

Browse files
committed
Add workaround for extern "C-unwind" not implementing common traits
1 parent a5aa781 commit 0067ae3

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
@@ -68,6 +68,10 @@ macro_rules! generate_linking_tests {
6868
// Get function pointer to make the linker require the
6969
// symbol to be available.
7070
let f: unsafe extern $abi fn($($t),*) $(-> $r)? = crate::$name;
71+
// Workaround for https://github.com/rust-lang/rust/pull/92964
72+
#[cfg(feature = "unstable-c-unwind")]
73+
#[allow(clippy::useless_transmute)]
74+
let f: unsafe extern "C" fn() = unsafe { core::mem::transmute(f) };
7175
// Execute side-effect to ensure it is not optimized away.
7276
std::println!("{:p}", f);
7377
}

0 commit comments

Comments
 (0)