rust/tests/ui/lint/inclusive-range-pattern-syntax.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
473 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
2021-06-16 07:27:44 -05:00
//~| WARN this is accepted in the current edition
_ => {}
}
match &despondency {
&1...2 => {}
//~^ WARN `...` range patterns are deprecated
2021-06-16 07:27:44 -05:00
//~| WARN this is accepted in the current edition
_ => {}
}
}