yield-closures
An implementation of MCP-49.
For the details of the proposal, see https://lang-team.rust-lang.org/design_notes/general_coroutines.html.
Differences between this implementation and the proposal are summarized below:
- This crate offers a macro implementation. It works with the stable Rust.
- No
FnPinis provided. Yield closures made with this crate useBox::pininternally and henceFnMut. - In yield closures, one cannot use
returnexpressions. - The body of a yield closure must be explosive i.e. must not return and typed by the
!type. Thus it is compatible with both of the two designs of yield closures discussed in the document of MCP-49: poisoning by default or not.