NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #839 most downloaded on crates.io
Apple's C language extension of blocks
Last release 1 years ago
04 Oct 2025
Ships fairly regularly
a new release about every 4 months
Nearly every release is documented
notes for 9 of 9 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
18 releases · first in 2021
One column per quarter.
Fix documentation on docs.rs
Fix documentation on docs.rs
chore: Release block2 version 0.6.1
chore: Release block2 version 0.6.1
DynBlock alias to help facilitate upgrading to v0.7 when that's done.ManualBlockEncoding.BREAKING: Removed the deprecated apple Cargo feature flag.
Added StackBlock::with_encoding and RcBlock::with_encoding for creating
blocks with an encoding specified by ManualBlockEncoding.
This is useful for certain APIs that require blocks to have an encoding.
Added RcBlock::as_ptr.
Added RcBlock::into_raw.
objc2 dependency to v0.6.0.extern "C-unwind".
This allows unwinding through blocks.apple Cargo feature flag.Deprecated the apple Cargo feature flag, it is assumed by default on Apple platforms.
apple Cargo feature flag, it is assumed by default on Apple
platforms.Renamed ConcreteBlock to StackBlock, and added a lifetime parameter. The old name is deprecated.
Block::copy to convert blocks to RcBlock. This
replaces StackBlock::copy, but since StackBlock implements Deref, this
will likely work as before.RcBlock::new(closure) as a more efficient and flexible alternative
to StackBlock::new(closure).copy().BlockFn trait to describe valid dyn Fn types for blocks.BREAKING: Changed how blocks specify their parameter and return types.
We now use dyn Fn so that it is more clear what the parameter and return
types are. This also allows us to support non-'static blocks.
// Before
let block: &Block<(), ()>;
let block: &Block<(i32,), i32>;
let block: &Block<(i32, u32), (i32, u32)>;
// After
let block: &Block<dyn Fn()>;
let block: &Block<dyn Fn(i32) -> i32>;
let block: &Block<dyn Fn(i32, u32) -> (i32, u32)>;
// Now possible
let block: &Block<dyn Fn() + '_>; // Non-'static block
BREAKING: Make Block::call safe, and instead move the upholding of the
safety invariant to the type itself.
BREAKING: Renamed RcBlock::new(ptr) to RcBlock::from_raw(ptr).
BREAKING: Made RcBlock use the null-pointer optimization;
RcBlock::from_raw and RcBlock::copy now return an Option.
BREAKING: Only expose the actually public symbols _Block_copy,
_Block_release, _Block_object_assign, _Block_object_dispose,
_NSConcreteGlobalBlock, _NSConcreteStackBlock and Class in ffi
module.
BREAKING: Renamed IntoConcreteBlock to IntoBlock, moved
associated type Output to be a generic parameter, and added lifetime
parameter.`
No longer use the block-sys crate for linking to the blocks runtime.
Renamed ConcreteBlock to StackBlock, and added a lifetime parameter. The
old name is deprecated.
Added Copy implementation for StackBlock.
BlockArguments in favour of BlockFn, which
describes both the parameter types, as well as the return type.StackBlock::new now requires the closure to be Clone. If
this is not desired, use RcBlock::new instead.F: Debug bound on StackBlock's Debug implementation.GlobalBlock not having the correct variance. This may
break if you were using lifetimes in your parameters, as those are now a bit
too restrictive.[0.4.0]: https://github.com/madsmtm/objc2/compare/block2-0.3.0...block2-0.4.0
objc2 dependency to v0.5.0.[0.3.0]: https://github.com/madsmtm/objc2/compare/block2-0.2.0...block2-0.3.0
0.2.0.[0.2.0]: https://github.com/madsmtm/objc2/compare/block2-0.2.0-alpha.8...block2-0.2.0
objc2 dependency to v0.4.0.[0.2.0-alpha.8]: https://github.com/madsmtm/objc2/compare/block2-0.2.0-alpha.7...block2-0.2.0-alpha.8
objc2 v0.3.0-beta.5 instead of
objc2-encode.ffi module to block-sys v0.2.0.[0.2.0-alpha.7]: https://github.com/madsmtm/objc2/compare/block2-0.2.0-alpha.6...block2-0.2.0-alpha.7
objc2-encode to v2.0.0-pre.3.ffi module to block-sys v0.1.0-beta.2.[0.2.0-alpha.6]: https://github.com/madsmtm/objc2/compare/block2-0.2.0-alpha.5...block2-0.2.0-alpha.6
objc2-encode to v2.0.0-pre.2.ffi module to block-sys v0.1.0-beta.1.BlockArguments trait, it is now sealed and a
subtrait of EncodeArguments.IntoConcreteBlock trait, it is now sealed and the
associated output type has been renamed to Output.[0.2.0-alpha.5]: https://github.com/madsmtm/objc2/compare/block2-0.2.0-alpha.4...block2-0.2.0-alpha.5
Debug for Block, ConcreteBlock, RcBlock and
GlobalBlock.objc2-encode to v2.0.0-pre.1.ffi module to block-sys v0.1.0-beta.0.[0.2.0-alpha.4]: https://github.com/madsmtm/objc2/compare/block2-0.2.0-alpha.3...block2-0.2.0-alpha.4
objc2-encode to v2.0.0-pre.0.ffi module to block-sys v0.0.4. This tweaks the
types of a lot of fields and parameters, and makes the apple runtime always
be the default.DerefMut implementation for ConcreteBlock.[0.2.0-alpha.3]: https://github.com/madsmtm/objc2/compare/block2-0.2.0-alpha.2...block2-0.2.0-alpha.3
global_block! macro to take an optional semicolon at the end.ffi module to block-sys v0.0.3.[0.2.0-alpha.2]: https://github.com/madsmtm/objc2/compare/block2-0.2.0-alpha.1...block2-0.2.0-alpha.2
GlobalBlock and corresponding global_block! macro, allowing statically
creating blocks that don't reference their environment.ffi module to block-sys v0.0.2. This means that
Class is now !UnwindSafe.[0.2.0-alpha.1]: https://github.com/madsmtm/objc2/compare/block2-0.2.0-alpha.0...block2-0.2.0-alpha.1
block-sys. See that crate for usage.block-sys as ffi module.objc_test_utils.ConcreteBlock no longer allocates block descriptors on the heap.ConcreteBlock::copy.[0.2.0-alpha.0]: https://github.com/madsmtm/objc2/compare/block2-0.1.6...block2-0.2.0-alpha.0
objc2_encode::Encode. This is a safety measure to prevent creating blocks
with invalid parameters.objc2_encode::RefEncode (and as such can be used in
Objective-C message sends).block2.[0.1.6]: https://github.com/madsmtm/objc2/compare/block2-0.1.5...block2-0.1.6
libBlocksRuntime.Your coding agent can read these notes before it upgrades. Set up the MCP server →