Skip to content

Implement needs_async_drop in rustc and optimize async drop glue#124662

Merged
bors merged 7 commits into
rust-lang:masterfrom
zetanumbers:needs_async_drop
May 31, 2024
Merged

Implement needs_async_drop in rustc and optimize async drop glue#124662
bors merged 7 commits into
rust-lang:masterfrom
zetanumbers:needs_async_drop

Conversation

@zetanumbers
Copy link
Copy Markdown
Contributor

This PR expands on #121801 and implements Ty::needs_async_drop which works almost exactly the same as Ty::needs_drop, which is needed for #123948.

Also made compiler's async drop code to look more like compiler's regular drop code, which enabled me to write an optimization where types which do not use AsyncDrop can simply forward async drop glue to drop_in_place. This made size of the async block from the async_drop test to decrease by 12%.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-async_drop `#![feature(async_drop)]` merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.