Skip to content

Commit aaff415

Browse files
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.
2 parents 495203b + 8facfb2 commit aaff415

File tree

1 file changed

+634
-584
lines changed

1 file changed

+634
-584
lines changed

0 commit comments

Comments
 (0)