Skip to content

Commit

Permalink
Make Coroutine constructors' generic type arguments require 'static
Browse files Browse the repository at this point in the history
  • Loading branch information
zetanumbers committed Oct 5, 2024
1 parent a6eb3dd commit b221e47
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/coroutine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ impl<Input, Yield, Return> Coroutine<Input, Yield, Return, DefaultStack> {
where
F: FnOnce(&Yielder<Input, Yield>, Input) -> Return,
F: 'static,
Input: 'static,
Yield: 'static,
Return: 'static,
{
Self::with_stack(Default::default(), f)
}
Expand All @@ -162,6 +165,9 @@ impl<Input, Yield, Return, Stack: stack::Stack> Coroutine<Input, Yield, Return,
where
F: FnOnce(&Yielder<Input, Yield>, Input) -> Return,
F: 'static,
Input: 'static,
Yield: 'static,
Return: 'static,
{
// The ABI of the initial function is either "C" or "C-unwind" depending
// on whether the "asm-unwind" feature is enabled.
Expand Down

0 comments on commit b221e47

Please sign in to comment.