rust/compiler/rustc_mir_build
Matthias Krüger 58a0f64c8b
Rollup merge of #121928 - Zalathar:then-else-args, r=Nadrieril
Extract an arguments struct for `Builder::then_else_break`

Most of this method's arguments are usually or always forwarded as-is to recursive invocations.

Wrapping them in a dedicated struct allows us to document each struct field, and lets us use struct-update syntax to indicate which arguments are being modified when making a recursive call.

---

While trying to understand the lowering of `if` expressions, I found it difficult to keep track of the half-dozen arguments passed through to every call to `then_else_break`. I tried switching over to an arguments struct, and I found that it really helps to make sense of what each argument does, and how each call is modifying the arguments.

I have some further ideas for how to streamline these recursive calls, but I've kept those out of this PR so that it's a pure refactoring with no behavioural changes.
2024-03-04 22:16:32 +01:00
..
src Rollup merge of #121928 - Zalathar:then-else-args, r=Nadrieril 2024-03-04 22:16:32 +01:00
Cargo.toml Use zip_eq to enforce that things being zipped have equal sizes 2024-01-14 20:01:12 +00:00
messages.ftl remove illegal_floating_point_literal_pattern lint 2024-01-26 17:25:02 +01:00