[][src]Static rustc_ap_rustc_session::lint::builtin::UNREACHABLE_PATTERNS

pub static  UNREACHABLE_PATTERNS: &Lint

The unreachable_patterns lint detects unreachable patterns.

Example

let x = 5;
match x {
    y => (),
    5 => (),
}

{{produces}}

Explanation

This usually indicates a mistake in how the patterns are specified or ordered. In this example, the y pattern will always match, so the five is impossible to reach. Remember, match arms match in order, you probably wanted to put the 5 case above the y case.