Docs menu

E093: A compare doesn't cover every value of its subject

What compiler error E093 means, and how to fix it.

Example
enum Color { Red, Green, Blue }compare c {    matches Color::Red:  ...  done    matches Color::Green ...  done}// ERROR: Non-exhaustive enum comparison on 'Color'.//        Missing variants: Color::Blue//   Hint: Add an arm for each missing variant, or 'otherwise:' (or//   `matches _:`) to handle the rest.

With no otherwise and no unguarded _, these subjects must be covered completely, because nothing else says what should happen to a value no arm names:

  • an enum or machine: every variant;
  • a bool: both true and false;
  • an error value (err in recover as err run): it can be any error a callee returns, so the set can’t be listed and it always needs otherwise or _.

A guarded arm never counts toward coverage, however complete it looks:

Example
matches Color::Green if ready:    // ready may be false, so Green is                                  // still not covered

An int, string or char subject is different: a compare over one may match nothing, in which case it does nothing.

A value of a declared error type (mut e: IOError = ..., unlike the open err) has a listable set of variants, so covering all of them is exhaustive without otherwise: each by an unguarded variant pattern whose fields all match anything (IOError::Denied(_, mode)). A variant whose pattern can fail (IOError::Denied(_, 0)) is not yet covered.

Run turf --explain E093 in a terminal to read this again.

Last updated: Oct 15, 2026Edit this page on GitHub

Esc

Type to search.