Skip to content

Commit

Permalink
Remove hidden __BlockLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Jan 7, 2024
1 parent eb85fbf commit d730c13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 5 additions & 3 deletions crates/block2/src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,15 @@ macro_rules! global_block {
let mut layout = $crate::GlobalBlock::<($($t,)*) $(, $r)?>::__DEFAULT_LAYOUT;
layout.isa = ::core::ptr::addr_of!($crate::ffi::_NSConcreteGlobalBlock);
layout.invoke = ::core::option::Option::Some({
unsafe extern "C" fn inner(_: *mut $crate::__BlockLayout, $($a: $t),*) $(-> $r)? {
unsafe extern "C" fn inner(_: *mut $crate::GlobalBlock<($($t,)*) $(, $r)?>, $($a: $t),*) $(-> $r)? {
$body
}
let inner: unsafe extern "C" fn(*mut $crate::__BlockLayout, $($a: $t),*) $(-> $r)? = inner;

// TODO: SAFETY
::core::mem::transmute(inner)
::core::mem::transmute::<
unsafe extern "C" fn(*mut $crate::GlobalBlock<($($t,)*) $(, $r)?>, $($a: $t),*) $(-> $r)?,
unsafe extern "C" fn(),
>(inner)
});
$crate::GlobalBlock::from_layout(layout)
};
Expand Down
2 changes: 0 additions & 2 deletions crates/block2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,6 @@ pub mod ffi;
mod global;
mod rc_block;

#[doc(hidden)]
pub use abi::BlockLayout as __BlockLayout;
pub use block::{Block, BlockArguments};
pub use concrete_block::{ConcreteBlock, IntoConcreteBlock};
pub use global::GlobalBlock;
Expand Down

0 comments on commit d730c13

Please sign in to comment.