Rollup merge of #119012 - workingjubilee:extract-enum-layout-fn, r=b-naber

Extract `layout_of_{struct,enum}` fn

While writing #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.
This commit is contained in:
Michael Goulet 2023-12-22 21:41:02 -05:00 committed by GitHub
commit aaff415322
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 634 additions and 584 deletions

File diff suppressed because it is too large Load Diff