Hacker News new | ask | show | jobs
by xfer 3013 days ago
Yeah, i have recently finished a tokio based server. Working with future combinators is very frustrating. I accidentally captured a variable in a closure(should be cloned and moved), and it didn't tell me where it happened, just an error saying requires 'static lifetime for the variable.
2 comments

The new async/await stuff will help a lot with this; it'll enable borrowing across futures, which will remove this requirement and make things a lot simpler.
Are there any plans to make them happen this year?
Not just this year, but by the third quarter.
I know this won't help you, but there is an issue tracking this: https://github.com/rust-lang/rust/issues/43353