1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
error: range pattern bounds cannot have parentheses
--> $DIR/recover-pat-ranges.rs:4:13
|
LL | 0..=(1) => (),
| ^ ^
|
help: remove these parentheses
|
LL - 0..=(1) => (),
LL + 0..=1 => (),
|
error: range pattern bounds cannot have parentheses
--> $DIR/recover-pat-ranges.rs:6:9
|
LL | (-12)..=4 => (),
| ^ ^
|
help: remove these parentheses
|
LL - (-12)..=4 => (),
LL + -12..=4 => (),
|
error: range pattern bounds cannot have parentheses
--> $DIR/recover-pat-ranges.rs:8:9
|
LL | (0)..=(-4) => (),
| ^ ^
|
help: remove these parentheses
|
LL - (0)..=(-4) => (),
LL + 0..=(-4) => (),
|
error: range pattern bounds cannot have parentheses
--> $DIR/recover-pat-ranges.rs:8:15
|
LL | (0)..=(-4) => (),
| ^ ^
|
help: remove these parentheses
|
LL - (0)..=(-4) => (),
LL + (0)..=-4 => (),
|
error: range pattern bounds cannot have parentheses
--> $DIR/recover-pat-ranges.rs:13:9
|
LL | (4).. => (),
| ^ ^
|
help: remove these parentheses
|
LL - (4).. => (),
LL + 4.. => (),
|
error: range pattern bounds cannot have parentheses
--> $DIR/recover-pat-ranges.rs:15:9
|
LL | (-4 + 0).. => (),
| ^ ^
|
help: remove these parentheses
|
LL - (-4 + 0).. => (),
LL + -4 + 0.. => (),
|
error: range pattern bounds cannot have parentheses
--> $DIR/recover-pat-ranges.rs:18:9
|
LL | (1 + 4)...1 * 2 => (),
| ^ ^
|
help: remove these parentheses
|
LL - (1 + 4)...1 * 2 => (),
LL + 1 + 4...1 * 2 => (),
|
error: expected a pattern range bound, found an expression
--> $DIR/recover-pat-ranges.rs:11:12
|
LL | ..=1 + 2 => (),
| ^^^^^ not a pattern
|
= note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html>
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = 1 + 2;
LL ~ match -1 {
LL | 0..=1 => (),
...
LL |
LL ~ ..=VAL => (),
|
error: expected a pattern range bound, found an expression
--> $DIR/recover-pat-ranges.rs:15:10
|
LL | (-4 + 0).. => (),
| ^^^^^^ not a pattern
|
= note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html>
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = -4 + 0;
LL ~ match -1 {
LL | 0..=1 => (),
...
LL |
LL ~ (VAL).. => (),
|
error: expected a pattern range bound, found an expression
--> $DIR/recover-pat-ranges.rs:18:10
|
LL | (1 + 4)...1 * 2 => (),
| ^^^^^ not a pattern
|
= note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html>
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = 1 + 4;
LL ~ match -1 {
LL | 0..=1 => (),
...
LL |
LL ~ (VAL)...1 * 2 => (),
|
error: expected a pattern range bound, found an expression
--> $DIR/recover-pat-ranges.rs:18:19
|
LL | (1 + 4)...1 * 2 => (),
| ^^^^^ not a pattern
|
= note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html>
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = 1 * 2;
LL ~ match -1 {
LL | 0..=1 => (),
...
LL |
LL ~ (1 + 4)...VAL => (),
|
error: expected a pattern range bound, found an expression
--> $DIR/recover-pat-ranges.rs:24:9
|
LL | 0.x()..="y".z() => (),
| ^^^^^ not a pattern
|
= note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html>
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = 0.x();
LL ~ match -1 {
LL | 0..=1 => (),
...
LL |
LL ~ VAL..="y".z() => (),
|
error: expected a pattern range bound, found an expression
--> $DIR/recover-pat-ranges.rs:24:17
|
LL | 0.x()..="y".z() => (),
| ^^^^^^^ not a pattern
|
= note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html>
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = "y".z();
LL ~ match -1 {
LL | 0..=1 => (),
...
LL |
LL ~ 0.x()..=VAL => (),
|
warning: `...` range patterns are deprecated
--> $DIR/recover-pat-ranges.rs:18:16
|
LL | (1 + 4)...1 * 2 => (),
| ^^^ help: use `..=` for an inclusive range
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
= note: `#[warn(ellipsis_inclusive_range_patterns)]` on by default
error: aborting due to 13 previous errors; 1 warning emitted
|