Skip to content

Commit

Permalink
explicitly mark coroutine closures.
Browse files Browse the repository at this point in the history
This is required with rust-lang/rust#123792
  • Loading branch information
soooch committed May 21, 2024
1 parent f002280 commit eabf715
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions effing-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ pub fn effectful(args: TokenStream, item: TokenStream) -> TokenStream {
Yield = #yield_type,
Return = #return_type
> #clone_bound {
#[coroutine]
move |_begin: <#yield_type as ::effing_mad::injection::EffectList>::Injections| {
#block
}
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ pub fn map<E, I, T, U>(
g: impl Coroutine<I, Yield = E, Return = T>,
f: impl FnOnce(T) -> U,
) -> impl Coroutine<I, Yield = E, Return = U> {
#[coroutine]
static move |mut injs: I| {
let mut pinned = pin!(g);
loop {
Expand Down Expand Up @@ -207,6 +208,7 @@ where
PostIs: CoproductEmbedder<PreIs, EmbedIndices>,
G: Coroutine<PreIs, Yield = PreEs, Return = R>,
{
#[coroutine]
static move |_begin: PostIs| {
let mut injection = PreIs::inject(Begin);
let mut pinned = pin!(g);
Expand Down Expand Up @@ -342,6 +344,7 @@ where
> + CoproductSubsetter<HandlerIs, SubsetIndices2>,
G1: Coroutine<PreIs, Yield = PreEs, Return = R>,
{
#[coroutine]
static move |_begin: PostIs| {
let mut injection = PreIs::inject(Begin);
let mut pinned = pin!(g);
Expand Down

0 comments on commit eabf715

Please sign in to comment.