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

Annotate panic! reasons during enum layout #118974

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

workingjubilee
Copy link
Member

Add some reasons to the panics, and use more exhaustive matches.

Also see: #118955

@rustbot
Copy link
Collaborator

rustbot commented Dec 15, 2023

r? @davidtwco

(rustbot has picked a reviewer for you, use r? to override)

@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 Dec 15, 2023
Add some reasons to the panics, and use more exhaustive matches.
@davidtwco
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 15, 2023

📌 Commit 0e9d400 has been approved by davidtwco

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 Dec 15, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 15, 2023
…iaskrgr

Rollup of 3 pull requests

Successful merges:

 - rust-lang#118962 (Annotate some bugs)
 - rust-lang#118969 (coverage: Use `Waker::noop` in async tests)
 - rust-lang#118974 (Annotate panic! reasons during enum layout)

Failed merges:

 - rust-lang#111658 (Refactor pre-getopts command line argument handling)
 - rust-lang#117449 (Avoid silencing relevant follow-up errors)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 88a9619 into rust-lang:master Dec 15, 2023
11 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 15, 2023
Rollup merge of rust-lang#118974 - workingjubilee:why-worry-about-enum-abi, r=davidtwco

Annotate panic! reasons during enum layout

Add some reasons to the panics, and use more exhaustive matches.

Also see: rust-lang#118955
@rustbot rustbot added this to the 1.76.0 milestone Dec 15, 2023
@workingjubilee workingjubilee deleted the why-worry-about-enum-abi branch December 15, 2023 20:02
@workingjubilee
Copy link
Member Author

For reasons unclear to me, bors thinks this is still a PR, thus:
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 15, 2023
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Dec 23, 2023
…-fn, r=b-naber

Extract `layout_of_{struct,enum}` fn

While writing rust-lang#118974 I noticed it was annoying to navigate a huge, several hundred line function, which handles many subcases, and make confident declarations about what part of the flow of execution the compiler would be in. To help with that, this breaks out `layout_of_struct_or_enum`'s fundamental logic into a pair of functions, one for each case. It changes essentially none of that logic, merely moves it around.

Because "the layout of an ADT" feels like a somewhat nebulous subject, I chose to deliberately avoid any expansions to LayoutCalculator's public API, though such does feel like a possible logical next step. There are, indeed, many logical next steps. I'm not taking any of them here, yet, because this comparatively tiny refactor is a prerequisite for all of them.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 23, 2023
Rollup merge of rust-lang#119012 - workingjubilee:extract-enum-layout-fn, r=b-naber

Extract `layout_of_{struct,enum}` fn

While writing rust-lang#118974 I noticed it was annoying to navigate a huge, several hundred line function, which handles many subcases, and make confident declarations about what part of the flow of execution the compiler would be in. To help with that, this breaks out `layout_of_struct_or_enum`'s fundamental logic into a pair of functions, one for each case. It changes essentially none of that logic, merely moves it around.

Because "the layout of an ADT" feels like a somewhat nebulous subject, I chose to deliberately avoid any expansions to LayoutCalculator's public API, though such does feel like a possible logical next step. There are, indeed, many logical next steps. I'm not taking any of them here, yet, because this comparatively tiny refactor is a prerequisite for all of them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants