rust/src/test/ui/lint/inclusive-range-pattern-syntax.fixed

22 lines
469 B
Rust
Raw Normal View History

2020-01-22 18:00:00 -06:00
// check-pass
// run-rustfix
#![warn(ellipsis_inclusive_range_patterns)]
fn main() {
let despondency = 2;
match despondency {
1..=2 => {}
//~^ WARN `...` range patterns are deprecated
//~| WARN this is valid in the current edition
_ => {}
}
match &despondency {
&(1..=2) => {}
//~^ WARN `...` range patterns are deprecated
//~| WARN this is valid in the current edition
_ => {}
}
}