How Rust optimizes async/await II: Program analysis

from blog Tyler Mandry, | ↗ original
In Part 1, we covered how async fns in Rust are compiled to state machines. We saw that the internal compiler implementation uses generators and the yield statement to facilitate this transformation. We also saw that the optimal way to lay out one of these state machines in memory is using an enum-like representation, similar to the following:...