rust icon indicating copy to clipboard operation
rust copied to clipboard

match lowering: don't collect test alternatives ahead of time

Open Nadrieril opened this issue 1 year ago • 2 comments

I'm very happy with this one. Before this, when sorting candidates into the possible test branches, we manually computed usize indices to determine in which branch each candidate goes. To make this work we had a first pass that collected the possible alternatives we'd have to deal with, and a second pass that actually sorts the candidates.

In this PR, I replace usize indices with a dedicated enum. This makes sort_candidates easier to follow, and we don't need the first pass anymore.

r? @matthewjasper

Nadrieril avatar Mar 02 '24 17:03 Nadrieril

@bors r+

matthewjasper avatar Mar 12 '24 16:03 matthewjasper

:pushpin: Commit d46ff6415c033ccfebac3d2a757908611a67d324 has been approved by matthewjasper

It is now in the queue for this repository.

bors avatar Mar 12 '24 16:03 bors