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

22 lines
467 B
Rust
Raw Normal View History

2020-01-23 00:00:00 +00: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
_ => {}
}
}