about summary refs log tree commit diff
path: root/compiler/rustc_attr/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-03-04 22:16:32 +0100
committerGitHub <noreply@github.com>2024-03-04 22:16:32 +0100
commit58a0f64c8b70a44619c0392fc877af8c6dc56858 (patch)
treef1fd617a7e81c543a9203ad2f5aa1c95bb0a3706 /compiler/rustc_attr/src
parent008ab3387b0057aa22cde00c544d05e31ab79807 (diff)
parent4146136d6dfd3a41f674b71bece81a33c74d824a (diff)
downloadrust-58a0f64c8b70a44619c0392fc877af8c6dc56858.tar.gz
rust-58a0f64c8b70a44619c0392fc877af8c6dc56858.zip
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.
Diffstat (limited to 'compiler/rustc_attr/src')
0 files changed, 0 insertions, 0 deletions