Skip to main content

Module exhaustiveness

Module exhaustiveness 

Source
Expand description

Exhaustiveness Checking for Match Expressions

Implements compile-time verification that all enum variants are covered in match expressions.

Rules:

  1. Patterns with where guards do NOT contribute to exhaustiveness coverage
  2. Unguarded _ (wildcard) or identifier pattern makes match exhaustive
  3. For enums: Uncovered = AllVariants - CoveredVariants

Enums§

ExhaustivenessResult
Result of exhaustiveness checking

Functions§

check_exhaustiveness
Check exhaustiveness of a match expression
check_exhaustiveness_for_type
Check exhaustiveness from inference-level type information.
require_exhaustive
Check a match expression and return an error if non-exhaustive