Clarity improvements to DropTree by Zalathar · Pull Request #122080 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation5 Commits4 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

Zalathar

These changes are based on some points of confusion I had when initially trying to understand this code.

The only “functional” change is an additional assertion in <ExitScopes as DropTreeBuilder>::link_entry_point, checking that the dummy terminator is TerminatorKind::UnwindResume as expected.

@Zalathar

@Zalathar

@Zalathar

This clarifies that we're adding an "entry point", not just adding an "entry" of some kind.

@Zalathar

This allows us to use real field names instead of tuple element numbers.

Renaming previous_drops to existing_drops_map clarifies that "previous" was unrelated to drop order.

@rustbot

r? @fmease

rustbot has assigned @fmease.
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.

labels

Mar 6, 2024

@Zalathar

Originally I had added a debug_assert!, but looking at the other implementations I noticed that they both have some kind of span_bug! assertion anyway, so adding one to the ExitScopes impl seems unobtrusive.

@fmease

Thanks! Generally makes sense but I don't feel comfortable approving this as I'm not super familiar with MIR (yet).

r? @oli-obk

@oli-obk

@bors

📌 Commit 5ba70bd 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

Mar 11, 2024

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Mar 11, 2024

@matthiaskrgr

Clarity improvements to DropTree

These changes are based on some points of confusion I had when initially trying to understand this code.

The only “functional” change is an additional assertion in <ExitScopes as DropTreeBuilder>::link_entry_point, checking that the dummy terminator is TerminatorKind::UnwindResume as expected.

bors added a commit to rust-lang-ci/rust that referenced this pull request

Mar 11, 2024

@bors

…kingjubilee

Rollup of 15 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Mar 11, 2024

@rust-timer

Rollup merge of rust-lang#122080 - Zalathar:drop-tree, r=oli-obk

Clarity improvements to DropTree

These changes are based on some points of confusion I had when initially trying to understand this code.

The only “functional” change is an additional assertion in <ExitScopes as DropTreeBuilder>::link_entry_point, checking that the dummy terminator is TerminatorKind::UnwindResume as expected.

Labels

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.