Closed
Description
Tentative tracking issue for the exhaustive_integer_patterns
feature, in which integer types may be exhaustively matched over their values. Original RFC thread: rust-lang/rfcs#1550.
- Implementation (Exhaustive integer matching #50912)
- Stabilisation (Rollup of 11 pull requests #56557)
#![feature(exhaustive_integer_patterns)]
#![feature(exclusive_range_pattern)]
fn matcher(x: u8) {
match x { // ok -- every value has been accounted for
0 .. 32 => { /* foo */ }
32 => { /* bar */ }
33 ..= 255 => { /* baz */ }
}
}