rust
rust copied to clipboard
match lowering: don't collect test alternatives ahead of time
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
@bors r+
:pushpin: Commit d46ff6415c033ccfebac3d2a757908611a67d324 has been approved by matthewjasper
It is now in the queue for this repository.