]> git.lizzy.rs Git - rust.git/commit
Avoid `GenFuture` shim when compiling async constructs
authorArpad Borsos <swatinem@swatinem.de>
Fri, 18 Nov 2022 21:56:22 +0000 (22:56 +0100)
committerArpad Borsos <swatinem@swatinem.de>
Thu, 24 Nov 2022 09:04:27 +0000 (10:04 +0100)
commit1ebdcca8b97feca67ce077a2bad87e7655bc774a
tree2b5a0f7d734821c4748c4da6f516a5435bda250f
parent91d2ce302020391df83620b622acea484c505b72
Avoid `GenFuture` shim when compiling async constructs

Previously, async constructs would be lowered to "normal" generators,
with an additional `from_generator` / `GenFuture` shim in between to
convert from `Generator` to `Future`.

The compiler will now special-case these generators internally so that
async constructs will *directly* implement `Future` without the need
to go through the `from_generator` / `GenFuture` shim.

The primary motivation for this change was hiding this implementation
detail in stack traces and debuginfo, but it can in theory also help
the optimizer as there is less abstractions to see through.
clippy_lints/src/doc.rs
clippy_lints/src/manual_async_fn.rs
tests/ui/author/blocks.stdout