You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #76749 - guswynn:hir_ranges, r=estebank
give *even better* suggestion when matching a const range
notice that the err already has "constant defined here"
so this is now *exceedingly clear*
extension to #76222
r? @estebank
| --------------------------------------------- constant defined here
27
+
...
28
+
LL | match n {
29
+
| - this expression has type `i32`
30
+
...
31
+
LL | RANGE2 => {}
32
+
| ^^^^^^
33
+
| |
34
+
| expected `i32`, found struct `RangeInclusive`
35
+
| `RANGE2` is interpreted as a constant, not a new binding
36
+
|
37
+
= note: expected type `i32`
38
+
found struct `RangeInclusive<i32>`
17
39
= note: constants only support matching by type, if you meant to match against a range of values, consider using a range pattern like `min ..= max` in the match block
18
40
19
-
error: aborting due to previous error
41
+
error: aborting due to 2 previous errors
20
42
21
43
For more information about this error, try `rustc --explain E0308`.
0 commit comments