2022-12-23 20:02:23 +00:00
|
|
|
error[E0005]: refutable pattern in local binding
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/const-pattern-irrefutable.rs:12:9
|
2017-11-04 00:01:56 +00:00
|
|
|
|
|
2019-09-28 00:30:48 +00:00
|
|
|
LL | const a: u8 = 2;
|
2022-02-13 15:27:59 +00:00
|
|
|
| ----------- constant defined here
|
2019-09-28 00:30:48 +00:00
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | let a = 4;
|
2019-09-28 00:30:48 +00:00
|
|
|
| ^
|
|
|
|
| |
|
2022-12-23 20:02:23 +00: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
|
2019-09-28 00:30:48 +00:00
|
|
|
| help: introduce a variable instead: `a_var`
|
2020-03-27 05:44:30 +00:00
|
|
|
|
|
|
|
|
= note: the matched value is of type `u8`
|
2017-11-04 00:01:56 +00:00
|
|
|
|
2022-12-23 20:02:23 +00:00
|
|
|
error[E0005]: refutable pattern in local binding
|
|
|
|
--> $DIR/const-pattern-irrefutable.rs:17:9
|
2017-11-04 00:01:56 +00:00
|
|
|
|
|
2019-09-28 00:30:48 +00:00
|
|
|
LL | pub const b: u8 = 2;
|
2022-02-13 15:27:59 +00:00
|
|
|
| --------------- constant defined here
|
2019-09-28 00:30:48 +00:00
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | let c = 4;
|
2019-09-28 00:30:48 +00:00
|
|
|
| ^
|
|
|
|
| |
|
2022-12-23 20:02:23 +00: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
|
2019-09-28 00:30:48 +00:00
|
|
|
| help: introduce a variable instead: `c_var`
|
2020-03-27 05:44:30 +00:00
|
|
|
|
|
|
|
|
= note: the matched value is of type `u8`
|
2017-11-04 00:01:56 +00:00
|
|
|
|
2022-12-23 20:02:23 +00:00
|
|
|
error[E0005]: refutable pattern in local binding
|
|
|
|
--> $DIR/const-pattern-irrefutable.rs:22:9
|
2017-11-04 00:01:56 +00:00
|
|
|
|
|
2019-09-28 00:30:48 +00:00
|
|
|
LL | pub const d: u8 = 2;
|
2022-02-13 15:27:59 +00:00
|
|
|
| --------------- constant defined here
|
2019-09-28 00:30:48 +00:00
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | let d = 4;
|
2019-09-28 00:30:48 +00:00
|
|
|
| ^
|
|
|
|
| |
|
2022-12-23 20:02:23 +00: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
|
2019-09-28 00:30:48 +00:00
|
|
|
| help: introduce a variable instead: `d_var`
|
2020-03-27 05:44:30 +00:00
|
|
|
|
|
|
|
|
= note: the matched value is of type `u8`
|
2017-11-04 00:01:56 +00:00
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
2018-03-03 14:59:40 +00:00
|
|
|
For more information about this error, try `rustc --explain E0005`.
|