From b221e4757f24e3f5c5b07ffc1f3e0f2e4a0d3026 Mon Sep 17 00:00:00 2001 From: Daria Sukhonina Date: Sat, 5 Oct 2024 12:40:33 +0300 Subject: [PATCH] Make Coroutine constructors' generic type arguments require 'static --- src/coroutine.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/coroutine.rs b/src/coroutine.rs index 71b2ccc..5d287c5 100644 --- a/src/coroutine.rs +++ b/src/coroutine.rs @@ -147,6 +147,9 @@ impl Coroutine { where F: FnOnce(&Yielder, Input) -> Return, F: 'static, + Input: 'static, + Yield: 'static, + Return: 'static, { Self::with_stack(Default::default(), f) } @@ -162,6 +165,9 @@ impl Coroutine, 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.