]>
Commit | Line | Data |
---|---|---|
136023e0 XL |
1 | fn main() { |
2 | let mut first_or = Vec::<i32>::new(); | |
3 | let mut or_two = Vec::<i32>::new(); | |
4 | let mut range_from = Vec::<i32>::new(); | |
5 | let mut bottom = Vec::<i32>::new(); | |
6 | let mut errors_only = Vec::<i32>::new(); | |
7 | ||
8 | for x in -9 + 1..=(9 - 2) { | |
9 | match x as i32 { | |
10 | 0..=(5+1) => errors_only.push(x), | |
11 | //~^ error: inclusive range with no end | |
12 | //~| error: expected one of `=>`, `if`, or `|`, found `(` | |
13 | 1 | -3..0 => first_or.push(x), | |
14 | y @ (0..5 | 6) => or_two.push(y), | |
15 | y @ 0..const { 5 + 1 } => assert_eq!(y, 5), | |
16 | y @ -5.. => range_from.push(y), | |
17 | y @ ..-7 => assert_eq!(y, -8), | |
18 | y => bottom.push(y), | |
19 | } | |
20 | } | |
21 | } |