[−][src]Static rustc_ap_rustc_session::lint::builtin::OVERLAPPING_PATTERNS
pub static OVERLAPPING_PATTERNS: &Lint
The overlapping_patterns
lint detects match
arms that have
range patterns that overlap.
Example
let x = 123u8; match x { 0..=100 => { println!("small"); } 100..=255 => { println!("large"); } }
{{produces}}
Explanation
It is likely a mistake to have range patterns in a match expression
that overlap. Check that the beginning and end values are what you
expect, and keep in mind that with ..=
the left and right bounds are
inclusive.