Skip to content
rusthacks.dev

Library

Everything you need to level up your coding skills.

Flat illustration for the post “Rust Error Recursion in an Async Fn Requires Boxing”, composed around threads.
Concurrency

Rust Error Recursion in an Async Fn Requires Boxing

A recursive async fn has an infinitely sized future, so the compiler asks for indirection. Return a boxed future with Box::pin, or use the async-recursion crate, and prefer a loop when you can.

7 min read

Get new posts by email

We send one email when a new post is published. No spam.

Unsubscribe in one click. No spam, ever.