Is it possible to de-sugar `async` with normal Rust syntax?

No, you can't easily desugar it.

async can create Future objects that are self-referential structs, and this is the only place in safe Rust where this is allowed.

It ends up being a state machine that uses unsafe pointers. It's not a straightforward translation, and there's no equivalent high-level syntax.

That unique complexity is the reason why .await is a built-in syntax. Otherwise it would be a crate with a proc_macro.

4 Likes