1
Fork 0
rust/tests/ui/consts/const-pattern-irrefutable.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.6 KiB
Text
Raw Normal View History

2022-12-23 21:02:23 +01:00
error[E0005]: refutable pattern in local binding
2018-12-25 08:56:47 -07:00
--> $DIR/const-pattern-irrefutable.rs:12:9
2017-11-04 03:01:56 +03:00
|
LL | const a: u8 = 2;
2022-02-13 16:27:59 +01:00
| ----------- constant defined here
...
2019-03-09 15:03:44 +03:00
LL | let a = 4;
| ^
| |
2022-12-23 21:02:23 +01:00
| patterns `0_u8..=1_u8` and `3_u8..=u8::MAX` not covered
| missing patterns are not covered because `a` is interpreted as a constant pattern, not a new variable
| help: introduce a variable instead: `a_var`
|
= note: the matched value is of type `u8`
2017-11-04 03:01:56 +03:00
2022-12-23 21:02:23 +01:00
error[E0005]: refutable pattern in local binding
--> $DIR/const-pattern-irrefutable.rs:17:9
2017-11-04 03:01:56 +03:00
|
LL | pub const b: u8 = 2;
2022-02-13 16:27:59 +01:00
| --------------- constant defined here
...
2019-03-09 15:03:44 +03:00
LL | let c = 4;
| ^
| |
2022-12-23 21:02:23 +01:00
| patterns `0_u8..=1_u8` and `3_u8..=u8::MAX` not covered
| missing patterns are not covered because `c` is interpreted as a constant pattern, not a new variable
| help: introduce a variable instead: `c_var`
|
= note: the matched value is of type `u8`
2017-11-04 03:01:56 +03:00
2022-12-23 21:02:23 +01:00
error[E0005]: refutable pattern in local binding
--> $DIR/const-pattern-irrefutable.rs:22:9
2017-11-04 03:01:56 +03:00
|
LL | pub const d: u8 = 2;
2022-02-13 16:27:59 +01:00
| --------------- constant defined here
...
2019-03-09 15:03:44 +03:00
LL | let d = 4;
| ^
| |
2022-12-23 21:02:23 +01:00
| patterns `0_u8..=1_u8` and `3_u8..=u8::MAX` not covered
| missing patterns are not covered because `d` is interpreted as a constant pattern, not a new variable
| help: introduce a variable instead: `d_var`
|
= note: the matched value is of type `u8`
2017-11-04 03:01:56 +03:00
error: aborting due to 3 previous errors
2018-03-03 15:59:40 +01:00
For more information about this error, try `rustc --explain E0005`.