Skip to main content

Module exhaustiveness

Module exhaustiveness 

Source
Expand description

This module contains the exhaustiveness checker for pattern matching.

The checker itself is not written yet: check accepts every module. What is here is the error it will report, and that is deliberate — an uninhabited enum Error {} made check unable to fail, which in turn made the conversion into a CompilationError a todo!() that nothing could reach and nobody had to justify. The first error the real checker reported would have panicked the compiler.

Enums§

Error
A case expression whose branches do not cover every variant of the type it scrutinises.

Functions§

check
Verify that every case expression in module covers its scrutinee’s variants.