Skip to content
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

Merged
merged 7 commits into from
May 31, 2024

Conversation

zetanumbers
Copy link
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%.

@rustbot
Copy link
Collaborator

rustbot commented May 3, 2024

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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 labels May 3, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 3, 2024

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

@bors
Copy link
Contributor

bors commented May 17, 2024

☔ The latest upstream changes (presumably #125150) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

@lcnr
Copy link
Contributor

lcnr commented May 20, 2024

r? @oli-obk

@rustbot rustbot assigned oli-obk and unassigned wesleywiser May 20, 2024
@bors
Copy link
Contributor

bors commented May 22, 2024

☔ The latest upstream changes (presumably #125335) made this pull request unmergeable. Please resolve the merge conflicts.

@oli-obk
Copy link
Contributor

oli-obk commented May 24, 2024

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)

@rustbot
Copy link
Collaborator

rustbot commented May 24, 2024

The Miri subtree was changed

cc @rust-lang/miri

@zetanumbers
Copy link
Contributor Author

The Miri subtree was changed

Somehow rebase triggered this check again, but I didn't change anything there from the last time.

@zetanumbers
Copy link
Contributor Author

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)

Yep, see the improvements in 74df792

Please don't be scared of these sizes tho 👀

@lqd
Copy link
Member

lqd commented May 24, 2024

The Miri subtree was changed

Somehow rebase triggered this check again, but I didn't change anything there from the last time.

it's this added test https://github.com/rust-lang/rust/pull/124662/files#diff-fae422507110acd4267c8af94b7552bd0ca7e0900015521f7e511160a05ea4a8

@bors
Copy link
Contributor

bors commented May 28, 2024

☔ The latest upstream changes (presumably #125665) made this pull request unmergeable. Please resolve the merge conflicts.

@oli-obk
Copy link
Contributor

oli-obk commented May 31, 2024

@bors r+

@bors
Copy link
Contributor

bors commented May 31, 2024

📌 Commit 4903cf4 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 31, 2024
@bors
Copy link
Contributor

bors commented May 31, 2024

⌛ Testing commit 4903cf4 with merge 99cb42c...

@bors
Copy link
Contributor

bors commented May 31, 2024

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 99cb42c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 31, 2024
@bors bors merged commit 99cb42c into rust-lang:master May 31, 2024
7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 31, 2024
@zetanumbers zetanumbers deleted the needs_async_drop branch May 31, 2024 12:28
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (99cb42c): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This 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.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 668.018s -> 667.778s (-0.04%)
Artifact size: 318.82 MiB -> 318.79 MiB (-0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants