Generate more precise generator names by eholk · Pull Request #92873 · rust-lang/rust (original) (raw)
Currently all generators are named with a generator$N
suffix, regardless of where they come from. This means an async fn
shows up as a generator in stack traces, which can be surprising to async programmers since they should not need to know that async functions are implementated using generators.
This change generators a different name depending on the generator kind, allowing us to tell whether the generator is the result of an async block, an async closure, an async fn, or a plain generator.