-
Notifications
You must be signed in to change notification settings - Fork 12.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement needs_async_drop
in rustc and optimize async drop glue
#124662
Conversation
r? @wesleywiser rustbot has assigned @wesleywiser. Use |
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
☔ The latest upstream changes (presumably #125150) made this pull request unmergeable. Please resolve the merge conflicts. |
e6961c0
to
d04e0ab
Compare
This comment has been minimized.
This comment has been minimized.
r? @oli-obk |
☔ The latest upstream changes (presumably #125335) made this pull request unmergeable. Please resolve the merge conflicts. |
a64f4e8
to
822a04e
Compare
Please add some MIR tests or at least size tests for affected async drop glue examples (ideally before the commits of this PR, so we can see the effect of them on the tests) |
822a04e
to
4406287
Compare
The Miri subtree was changed cc @rust-lang/miri |
4406287
to
74df792
Compare
Somehow rebase triggered this check again, but I didn't change anything there from the last time. |
Yep, see the improvements in 74df792 Please don't be scared of these sizes tho 👀 |
it's this added test https://github.com/rust-lang/rust/pull/124662/files#diff-fae422507110acd4267c8af94b7552bd0ca7e0900015521f7e511160a05ea4a8 |
☔ The latest upstream changes (presumably #125665) made this pull request unmergeable. Please resolve the merge conflicts. |
98c0d7b
to
4903cf4
Compare
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (99cb42c): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 668.018s -> 667.778s (-0.04%) |
This PR expands on #121801 and implements
Ty::needs_async_drop
which works almost exactly the same asTy::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 todrop_in_place
. This made size of the async block from the async_drop test to decrease by 12%.