Skip to content

Commit ffe7123

Browse files
authored
Rollup merge of #150238 - Zalathar:pat-const-kind, r=Nadrieril
mir_build: Classify `TestableCase::Constant` into multiple sub-kinds In match lowering, when choosing a test for a `TestableCase::Constant`, there is some ad-hoc logic for inspecting the pattern type and deciding what kind of test is suitable. There is also some very similar logic later, when partitioning cases into buckets based on the chosen test. Instead of having that ad-hoc logic in multiple places, I think it's better to perform an up-front classification when lowering `thir::PatKind::Constant` to `TestableCase::Constant`, and then have the later steps simply match on an enum variant. There should be no change to the resulting built MIR. (I will note that the logic/invariants involved are a bit unclear, so there is a risk of accidental minor differences.)
2 parents 78286ef + 22e65f6 commit ffe7123

0 file changed

File tree

    0 commit comments

    Comments
     (0)