E0254

An unreachable arm: the earlier unguarded arms already match every value it does, as with any arm after a _ or binding arm. Spans the arm's pattern.

Machine-applicable fix: none.

Example

This program fails with E0254.

fn count(x: Option<Int>) -> Int {
    match x {
        _ => 0
        Some(n) => n
    }
}

Fixed

The same program, fixed.

fn count(x: Option<Int>) -> Int {
    match x {
        Some(n) => n
        _ => 0
    }
}

Listed in the checker notes. oskac explain E0254 prints this entry offline.

All error codes