diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-03-04 22:16:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-04 22:16:32 +0100 |
| commit | 58a0f64c8b70a44619c0392fc877af8c6dc56858 (patch) | |
| tree | f1fd617a7e81c543a9203ad2f5aa1c95bb0a3706 /compiler/rustc_attr/src | |
| parent | 008ab3387b0057aa22cde00c544d05e31ab79807 (diff) | |
| parent | 4146136d6dfd3a41f674b71bece81a33c74d824a (diff) | |
| download | rust-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
