]>
Commit | Line | Data |
---|---|---|
6a06907d | 1 | error[E0004]: non-exhaustive patterns: type `u8` is non-empty |
064997fb | 2 | --> $DIR/pattern-matching-should-fail.rs:67:23 |
6a06907d XL |
3 | | |
4 | LL | let c1 = || match x { }; | |
5 | | ^ | |
6 | | | |
6a06907d | 7 | = note: the matched value is of type `u8` |
5e7ed085 FG |
8 | help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown |
9 | | | |
10 | LL ~ let c1 = || match x { | |
11 | LL + _ => todo!(), | |
12 | LL ~ }; | |
13 | | | |
6a06907d | 14 | |
064997fb | 15 | error[E0381]: used binding `x` isn't initialized |
136023e0 | 16 | --> $DIR/pattern-matching-should-fail.rs:8:23 |
6a06907d | 17 | | |
064997fb FG |
18 | LL | let x: !; |
19 | | - binding declared here but left uninitialized | |
6a06907d | 20 | LL | let c1 = || match x { }; |
064997fb | 21 | | ^ `x` used here but it isn't initialized |
6a06907d | 22 | |
064997fb | 23 | error[E0381]: used binding `x` isn't initialized |
136023e0 | 24 | --> $DIR/pattern-matching-should-fail.rs:15:14 |
6a06907d | 25 | | |
064997fb FG |
26 | LL | let x: !; |
27 | | - binding declared here but left uninitialized | |
6a06907d XL |
28 | LL | let c2 = || match x { _ => () }; |
29 | | ^^ - borrow occurs due to use in closure | |
30 | | | | |
064997fb | 31 | | `x` used here but it isn't initialized |
6a06907d | 32 | |
064997fb | 33 | error[E0381]: used binding `variant` isn't initialized |
136023e0 | 34 | --> $DIR/pattern-matching-should-fail.rs:27:13 |
6a06907d | 35 | | |
064997fb FG |
36 | LL | let variant: !; |
37 | | ------- binding declared here but left uninitialized | |
6a06907d | 38 | LL | let c = || { |
064997fb | 39 | | ^^ `variant` used here but it isn't initialized |
6a06907d XL |
40 | LL | |
41 | LL | match variant { | |
42 | | ------- borrow occurs due to use in closure | |
43 | ||
064997fb | 44 | error[E0381]: used binding `variant` isn't initialized |
136023e0 | 45 | --> $DIR/pattern-matching-should-fail.rs:39:13 |
6a06907d | 46 | | |
064997fb FG |
47 | LL | let variant: !; |
48 | | ------- binding declared here but left uninitialized | |
6a06907d | 49 | LL | let c = || { |
064997fb | 50 | | ^^ `variant` used here but it isn't initialized |
6a06907d XL |
51 | LL | match variant { |
52 | | ------- borrow occurs due to use in closure | |
53 | ||
064997fb FG |
54 | error[E0381]: used binding `g` isn't initialized |
55 | --> $DIR/pattern-matching-should-fail.rs:54:15 | |
6a06907d | 56 | | |
064997fb FG |
57 | LL | let g: !; |
58 | | - binding declared here but left uninitialized | |
59 | ... | |
6a06907d | 60 | LL | match g { }; |
064997fb | 61 | | ^ `g` used here but it isn't initialized |
6a06907d | 62 | |
064997fb FG |
63 | error[E0381]: used binding `t` isn't initialized |
64 | --> $DIR/pattern-matching-should-fail.rs:56:19 | |
6a06907d | 65 | | |
064997fb FG |
66 | LL | let t: !; |
67 | | - binding declared here but left uninitialized | |
68 | ... | |
6a06907d | 69 | LL | match t { }; |
064997fb | 70 | | ^ `t` used here but it isn't initialized |
6a06907d | 71 | |
064997fb FG |
72 | error[E0381]: used binding `x` isn't initialized |
73 | --> $DIR/pattern-matching-should-fail.rs:67:23 | |
6a06907d | 74 | | |
064997fb FG |
75 | LL | let x: u8; |
76 | | - binding declared here but left uninitialized | |
6a06907d | 77 | LL | let c1 = || match x { }; |
064997fb | 78 | | ^ `x` used here but it isn't initialized |
2b03887a FG |
79 | | |
80 | help: consider assigning a value | |
81 | | | |
82 | LL | let x: u8 = 0; | |
83 | | +++ | |
6a06907d | 84 | |
136023e0 | 85 | error: aborting due to 8 previous errors |
6a06907d XL |
86 | |
87 | Some errors have detailed explanations: E0004, E0381. | |
88 | For more information about an error, try `rustc --explain E0004`. |