1
1
error[E0080]: evaluation of constant value failed
2
- --> $DIR/literals.rs:93 :62
2
+ --> $DIR/literals.rs:86 :62
3
3
|
4
4
LL | fn empty_range_at_base_type_min() -> pattern_type!(u32 is 0..0) {
5
5
| ^ attempt to compute `0_u32 - 1_u32`, which would overflow
6
6
7
7
error[E0080]: evaluation of constant value failed
8
- --> $DIR/literals.rs:98 :63
8
+ --> $DIR/literals.rs:91 :63
9
9
|
10
10
LL | fn empty_range_at_base_type_min2() -> pattern_type!(u32 is 0..0) {
11
11
| ^ attempt to compute `0_u32 - 1_u32`, which would overflow
12
12
13
13
error[E0080]: evaluation of constant value failed
14
- --> $DIR/literals.rs:113 :65
14
+ --> $DIR/literals.rs:106 :65
15
15
|
16
16
LL | fn wraparound_range_at_base_ty_end() -> pattern_type!(u32 is 1..0) {
17
17
| ^ attempt to compute `0_u32 - 1_u32`, which would overflow
18
18
19
19
error[E0080]: evaluation of constant value failed
20
- --> $DIR/literals.rs:118 :66
20
+ --> $DIR/literals.rs:111 :66
21
21
|
22
22
LL | fn wraparound_range_at_base_ty_end2() -> pattern_type!(u32 is 1..0) {
23
23
| ^ attempt to compute `0_u32 - 1_u32`, which would overflow
24
24
25
25
error[E0080]: evaluation of constant value failed
26
- --> $DIR/literals.rs:123 :66
26
+ --> $DIR/literals.rs:116 :66
27
27
|
28
28
LL | fn wraparound_range_at_base_ty_end3() -> pattern_type!(u32 is 1..0) {
29
29
| ^ attempt to compute `0_u32 - 1_u32`, which would overflow
@@ -39,63 +39,20 @@ LL | 0
39
39
= note: expected pattern type `(u32) is 1..`
40
40
found type `{integer}`
41
41
42
- error[E0308]: mismatched types
43
- --> $DIR/literals.rs:14:5
44
- |
45
- LL | fn at_range_start() -> pattern_type!(u32 is 1..) {
46
- | ------------------------- expected `(u32) is 1..` because of return type
47
- LL | 1
48
- | ^ expected `(u32) is 1..`, found integer
49
- |
50
- = note: expected pattern type `(u32) is 1..`
51
- found type `{integer}`
52
-
53
- error[E0308]: mismatched types
54
- --> $DIR/literals.rs:19:5
55
- |
56
- LL | fn in_range() -> pattern_type!(u32 is 1..) {
57
- | ------------------------- expected `(u32) is 1..` because of return type
58
- LL | 2
59
- | ^ expected `(u32) is 1..`, found integer
60
- |
61
- = note: expected pattern type `(u32) is 1..`
62
- found type `{integer}`
63
-
64
- error[E0308]: mismatched types
65
- --> $DIR/literals.rs:24:5
42
+ error[E0600]: cannot apply unary operator `-` to type `(u32) is 1..`
43
+ --> $DIR/literals.rs:22:5
66
44
|
67
- LL | fn negative_lit_on_unsigned_ty() -> pattern_type!(u32 is 1..) {
68
- | ------------------------- expected `(u32) is 1..` because of return type
69
45
LL | -3
70
- | ^^ expected `(u32) is 1..`, found integer
71
- |
72
- = note: expected pattern type `(u32) is 1..`
73
- found type `{integer}`
46
+ | ^^ cannot apply unary operator `-`
74
47
75
- error[E0308 ]: mismatched types
76
- --> $DIR/literals.rs:29 :5
48
+ error[E0600 ]: cannot apply unary operator `-` to type `(i8) is -5..=4`
49
+ --> $DIR/literals.rs:27 :5
77
50
|
78
- LL | fn negative_lit_in_range() -> pattern_type!(i8 is -5..5) {
79
- | -------------------------- expected `(i8) is -5..=4` because of return type
80
51
LL | -2
81
- | ^^ expected `(i8) is -5..=4`, found integer
82
- |
83
- = note: expected pattern type `(i8) is -5..=4`
84
- found type `{integer}`
52
+ | ^^ cannot apply unary operator `-`
85
53
86
54
error[E0308]: mismatched types
87
- --> $DIR/literals.rs:34:5
88
- |
89
- LL | fn positive_lit_in_range_of_signed() -> pattern_type!(i8 is -5..5) {
90
- | -------------------------- expected `(i8) is -5..=4` because of return type
91
- LL | 2
92
- | ^ expected `(i8) is -5..=4`, found integer
93
- |
94
- = note: expected pattern type `(i8) is -5..=4`
95
- found type `{integer}`
96
-
97
- error[E0308]: mismatched types
98
- --> $DIR/literals.rs:39:5
55
+ --> $DIR/literals.rs:36:5
99
56
|
100
57
LL | fn negative_lit_at_range_start() -> pattern_type!(i8 is -5..5) {
101
58
| -------------------------- expected `(i8) is -5..=4` because of return type
@@ -106,18 +63,7 @@ LL | -5
106
63
found type `{integer}`
107
64
108
65
error[E0308]: mismatched types
109
- --> $DIR/literals.rs:44:5
110
- |
111
- LL | fn positive_lit_at_range_end() -> pattern_type!(i8 is -5..5) {
112
- | -------------------------- expected `(i8) is -5..=4` because of return type
113
- LL | 4
114
- | ^ expected `(i8) is -5..=4`, found integer
115
- |
116
- = note: expected pattern type `(i8) is -5..=4`
117
- found type `{integer}`
118
-
119
- error[E0308]: mismatched types
120
- --> $DIR/literals.rs:49:5
66
+ --> $DIR/literals.rs:45:5
121
67
|
122
68
LL | fn lit_one_beyond_range_end() -> pattern_type!(i8 is -5..5) {
123
69
| -------------------------- expected `(i8) is -5..=4` because of return type
@@ -128,7 +74,7 @@ LL | 5
128
74
found type `{integer}`
129
75
130
76
error[E0308]: mismatched types
131
- --> $DIR/literals.rs:54 :5
77
+ --> $DIR/literals.rs:50 :5
132
78
|
133
79
LL | fn wrong_lit_kind() -> pattern_type!(u32 is 1..) {
134
80
| ------------------------- expected `(u32) is 1..` because of return type
@@ -139,7 +85,7 @@ LL | '3'
139
85
found type `char`
140
86
141
87
error[E0308]: mismatched types
142
- --> $DIR/literals.rs:59 :5
88
+ --> $DIR/literals.rs:55 :5
143
89
|
144
90
LL | fn char_lit_in_range() -> pattern_type!(char is 'a'..'z') {
145
91
| ------------------------------- expected `(char) is 'a'..='y'` because of return type
@@ -150,7 +96,7 @@ LL | 'b'
150
96
found type `char`
151
97
152
98
error[E0308]: mismatched types
153
- --> $DIR/literals.rs:64 :5
99
+ --> $DIR/literals.rs:60 :5
154
100
|
155
101
LL | fn char_lit_out_of_range() -> pattern_type!(char is 'a'..'z') {
156
102
| ------------------------------- expected `(char) is 'a'..='y'` because of return type
@@ -161,29 +107,7 @@ LL | 'A'
161
107
found type `char`
162
108
163
109
error[E0308]: mismatched types
164
- --> $DIR/literals.rs:69:5
165
- |
166
- LL | fn lit_at_unsigned_range_inclusive_end() -> pattern_type!(u32 is 0..=1) {
167
- | --------------------------- expected `(u32) is 0..=1` because of return type
168
- LL | 1
169
- | ^ expected `(u32) is 0..=1`, found integer
170
- |
171
- = note: expected pattern type `(u32) is 0..=1`
172
- found type `{integer}`
173
-
174
- error[E0308]: mismatched types
175
- --> $DIR/literals.rs:74:5
176
- |
177
- LL | fn single_element_range() -> pattern_type!(u32 is 0..=0) {
178
- | --------------------------- expected `(u32) is 0..=0` because of return type
179
- LL | 0
180
- | ^ expected `(u32) is 0..=0`, found integer
181
- |
182
- = note: expected pattern type `(u32) is 0..=0`
183
- found type `{integer}`
184
-
185
- error[E0308]: mismatched types
186
- --> $DIR/literals.rs:79:5
110
+ --> $DIR/literals.rs:73:5
187
111
|
188
112
LL | fn lit_oob_single_element_range() -> pattern_type!(u32 is 0..=0) {
189
113
| --------------------------- expected `(u32) is 0..=0` because of return type
@@ -194,7 +118,7 @@ LL | 1
194
118
found type `{integer}`
195
119
196
120
error[E0308]: mismatched types
197
- --> $DIR/literals.rs:84 :5
121
+ --> $DIR/literals.rs:78 :5
198
122
|
199
123
LL | fn lit_oob_single_element_range_exclusive() -> pattern_type!(u32 is 0..1) {
200
124
| -------------------------- expected `(u32) is 0..=0` because of return type
@@ -204,19 +128,10 @@ LL | 1
204
128
= note: expected pattern type `(u32) is 0..=0`
205
129
found type `{integer}`
206
130
207
- error[E0308]: mismatched types
208
- --> $DIR/literals.rs:89:5
209
- |
210
- LL | fn single_element_range_exclusive() -> pattern_type!(u32 is 0..1) {
211
- | -------------------------- expected `(u32) is 0..=0` because of return type
212
- LL | 0
213
- | ^ expected `(u32) is 0..=0`, found integer
214
- |
215
- = note: expected pattern type `(u32) is 0..=0`
216
- found type `{integer}`
131
+ error: pattern type ranges cannot wrap: 1..=0
217
132
218
133
error[E0308]: mismatched types
219
- --> $DIR/literals.rs:104 :5
134
+ --> $DIR/literals.rs:97 :5
220
135
|
221
136
LL | fn empty_range() -> pattern_type!(u32 is 1..1) {
222
137
| -------------------------- expected `(u32) is 1..=0` because of return type
@@ -227,7 +142,7 @@ LL | 0
227
142
found type `{integer}`
228
143
229
144
error[E0308]: mismatched types
230
- --> $DIR/literals.rs:109 :5
145
+ --> $DIR/literals.rs:102 :5
231
146
|
232
147
LL | fn empty_range2() -> pattern_type!(u32 is 1..1) {
233
148
| -------------------------- expected `(u32) is 1..=0` because of return type
@@ -237,8 +152,10 @@ LL | 1
237
152
= note: expected pattern type `(u32) is 1..=0`
238
153
found type `{integer}`
239
154
155
+ error: pattern type ranges cannot wrap: 2..=0
156
+
240
157
error[E0308]: mismatched types
241
- --> $DIR/literals.rs:129 :5
158
+ --> $DIR/literals.rs:122 :5
242
159
|
243
160
LL | fn wraparound_range() -> pattern_type!(u32 is 2..1) {
244
161
| -------------------------- expected `(u32) is 2..=0` because of return type
@@ -249,7 +166,7 @@ LL | 1
249
166
found type `{integer}`
250
167
251
168
error[E0308]: mismatched types
252
- --> $DIR/literals.rs:134 :5
169
+ --> $DIR/literals.rs:127 :5
253
170
|
254
171
LL | fn lit_in_wraparound_range() -> pattern_type!(u32 is 2..1) {
255
172
| -------------------------- expected `(u32) is 2..=0` because of return type
@@ -260,7 +177,7 @@ LL | 0
260
177
found type `{integer}`
261
178
262
179
error[E0308]: mismatched types
263
- --> $DIR/literals.rs:139 :5
180
+ --> $DIR/literals.rs:132 :5
264
181
|
265
182
LL | fn lit_at_wraparound_range_start() -> pattern_type!(u32 is 2..1) {
266
183
| -------------------------- expected `(u32) is 2..=0` because of return type
@@ -270,7 +187,7 @@ LL | 2
270
187
= note: expected pattern type `(u32) is 2..=0`
271
188
found type `{integer}`
272
189
273
- error: aborting due to 27 previous errors
190
+ error: aborting due to 22 previous errors
274
191
275
- Some errors have detailed explanations: E0080, E0308.
192
+ Some errors have detailed explanations: E0080, E0308, E0600 .
276
193
For more information about an error, try `rustc --explain E0080`.
0 commit comments