Skip to content

Commit

Permalink
Add workaround for extern "C-unwind" not implementing common traits
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Jun 24, 2022
1 parent fa3fd4c commit bb25515
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions objc-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ macro_rules! generate_linking_tests {
// Get function pointer to make the linker require the
// symbol to be available.
let f: unsafe extern $abi fn($($t),*) $(-> $r)? = crate::$name;
// Workaround for https://github.com/rust-lang/rust/pull/92964
#[cfg(feature = "unstable-c-unwind")]
#[allow(clippy::useless_transmute)]
let f: unsafe extern "C" fn() = unsafe { core::mem::transmute(f) };
// Execute side-effect to ensure it is not optimized away.
std::println!("{:p}", f);
}
Expand Down

0 comments on commit bb25515

Please sign in to comment.