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.
This commit is contained in:
@@ -81,10 +81,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
let then_blk = unpack!(this.then_else_break(
|
||||
block,
|
||||
cond,
|
||||
Some(condition_scope),
|
||||
Some(condition_scope), // Temp scope
|
||||
condition_scope,
|
||||
source_info,
|
||||
true,
|
||||
true, // Declare `let` bindings normally
|
||||
));
|
||||
|
||||
this.expr_into_dest(destination, then_blk, then)
|
||||
@@ -146,9 +146,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
this.then_else_break(
|
||||
block,
|
||||
lhs,
|
||||
Some(condition_scope),
|
||||
Some(condition_scope), // Temp scope
|
||||
condition_scope,
|
||||
source_info,
|
||||
// This flag controls how inner `let` expressions are lowered,
|
||||
// but either way there shouldn't be any of those in here.
|
||||
true,
|
||||
)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user