S0023: non-exhaustive match
Generated from rellum-diagnostics/src/db.rs.
Explanation
The compiler proves match exhaustiveness statically so every value has a defined result at runtime. A match that omits some Option, Result, Bool, enum, or record shape could otherwise reach a tick with no selected arm.
Common causes
- matching some(x) without a none arm
- matching ok(x) without an err arm
- matching only some variants of an enum
- omitting else for a guard-based match
Canonical fixes
- add the missing arms
Before:
match value
some(x) => x
After:
match value
some(x) => x
none => 0
- add an else arm when one fallback behavior is correct
Before:
match flag
true => 1
After:
match flag
true => 1
else => 0
Code example
match value
some(x) => x