]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-pattern-irrefutable.stderr
Rollup merge of #106927 - Ezrashaw:e0606-make-machine-applicable, r=estebank
[rust.git] / tests / ui / consts / const-pattern-irrefutable.stderr
1 error[E0005]: refutable pattern in local binding
2   --> $DIR/const-pattern-irrefutable.rs:12:9
3    |
4 LL | const a: u8 = 2;
5    | ----------- constant defined here
6 ...
7 LL |     let a = 4;
8    |         ^
9    |         |
10    |         patterns `0_u8..=1_u8` and `3_u8..=u8::MAX` not covered
11    |         missing patterns are not covered because `a` is interpreted as a constant pattern, not a new variable
12    |         help: introduce a variable instead: `a_var`
13    |
14    = note: the matched value is of type `u8`
15
16 error[E0005]: refutable pattern in local binding
17   --> $DIR/const-pattern-irrefutable.rs:17:9
18    |
19 LL |     pub const b: u8 = 2;
20    |     --------------- constant defined here
21 ...
22 LL |     let c = 4;
23    |         ^
24    |         |
25    |         patterns `0_u8..=1_u8` and `3_u8..=u8::MAX` not covered
26    |         missing patterns are not covered because `c` is interpreted as a constant pattern, not a new variable
27    |         help: introduce a variable instead: `c_var`
28    |
29    = note: the matched value is of type `u8`
30
31 error[E0005]: refutable pattern in local binding
32   --> $DIR/const-pattern-irrefutable.rs:22:9
33    |
34 LL |     pub const d: u8 = 2;
35    |     --------------- constant defined here
36 ...
37 LL |     let d = 4;
38    |         ^
39    |         |
40    |         patterns `0_u8..=1_u8` and `3_u8..=u8::MAX` not covered
41    |         missing patterns are not covered because `d` is interpreted as a constant pattern, not a new variable
42    |         help: introduce a variable instead: `d_var`
43    |
44    = note: the matched value is of type `u8`
45
46 error: aborting due to 3 previous errors
47
48 For more information about this error, try `rustc --explain E0005`.