fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// In expression, `&a..=b` is treated as `(&a)..=(b)` and `box a..=b` is 2// `(box a)..=(b)`. In a pattern, however, `&a..=b` means `&(a..=b)`. This may 3// lead to confusion. 4 5// run-rustfix 6 7#![warn(ellipsis_inclusive_range_patterns)] 8 9pub fn main() { 10 match &12 { 11 &(0..=9) => {} 12 //~^ WARN `...` range patterns are deprecated 13 //~| WARN this is accepted in the current edition 14 //~| HELP use `..=` for an inclusive range 15 &(10..=15) => {} 16 //~^ ERROR the range pattern here has ambiguous interpretation 17 //~| HELP add parentheses to clarify the precedence 18 &(16..=20) => {} 19 _ => {} 20 } 21}