Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Jul 9, 2024
1 parent 3e030b3 commit 42772e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/rustc_mir_build/src/build/matches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1437,17 +1437,17 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
candidates: &mut [&mut Candidate<'_, 'tcx>],
) -> BasicBlock {
ensure_sufficient_stack(|| {
self.match_candidates_with_enough_stack(span, scrutinee_span, start_block, candidates)
self.match_candidates_inner(span, scrutinee_span, start_block, candidates)
})
}

/// Construct the decision tree for `candidates`. Don't call this, call `match_candidates`
/// instead to reserve sufficient stack space.
fn match_candidates_with_enough_stack(
fn match_candidates_inner(
&mut self,
span: Span,
scrutinee_span: Span,
start_block: BasicBlock,
mut start_block: BasicBlock,
candidates: &mut [&mut Candidate<'_, 'tcx>],
) -> BasicBlock {
if let [first, ..] = candidates {
Expand Down Expand Up @@ -1480,7 +1480,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
};

// Process any candidates that remain.
let BlockAnd(start_block, remaining_candidates) = rest;
let remaining_candidates = unpack!(start_block = rest);
self.match_candidates(span, scrutinee_span, start_block, remaining_candidates)
}

Expand Down

0 comments on commit 42772e9

Please sign in to comment.