Skip to content
Commit 6701e2bf authored by Jim Blandy's avatar Jim Blandy Committed by Dzmitry Malyshau
Browse files

Avoid non-exhaustive matches on Expression.

Non-exhaustive matches on `Expression` make it harder to review changes that add
new enum variants, because the compiler can't tell you that you've missed a
case.

Although I believe Clippy is able to do so, I don't think we should make a
blanket rule of forbidding wildcard match arms against `Expression`. There are a
few matches that are only concerned with a handful of variants, or a single
variant. For example, variant, naga::front::spv::Parser::next_block is only
concerned with whether an expression is a constant or not. In principle, these
sites should also be checked when adding a new variant, but it seems too
burdensome to require them to list all the `Expression` variants they don't care
about. The principle should be applied only to matches that are already handling
most variants.

At the moment, there is only one such match on `Expression` in the code base,
and it's only missing a few variants, so this is quick to fix.
parent c2c93e4e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment