"expected bound lifetime parameter, found concrete lifetime" when passing a 'static reference to a closure that returns a future #68521
Labels
A-async-await
Area: Async & Await
A-closures
Area: Closures (`|…| { … }`)
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lifetimes
Area: Lifetimes / regions
AsyncAwait-Triaged
Async-await issues that have been triaged during a working group meeting.
C-bug
Category: This is a bug.
P-medium
Medium priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
(Playground)
Errors:
I can make the code work by restricting the closure to only accept
'static
references:I did try to add
'static
bounds to the response future (and the closure, for good measure), but this did not help:The equivalent(?) synchronous code works as I'd expect:
The text was updated successfully, but these errors were encountered: