]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr
Merge commit '7f27e2e74ef957baa382dc05cf08df6368165c74' into clippyup
[rust.git] / tests / ui / closures / 2229_closure_analysis / match / pattern-matching-should-fail.stderr
1 error[E0004]: non-exhaustive patterns: type `u8` is non-empty
2   --> $DIR/pattern-matching-should-fail.rs:67:23
3    |
4 LL |     let c1 = || match x { };
5    |                       ^
6    |
7    = note: the matched value is of type `u8`
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    |
14
15 error[E0381]: used binding `x` isn't initialized
16   --> $DIR/pattern-matching-should-fail.rs:8:23
17    |
18 LL |     let x: !;
19    |         - binding declared here but left uninitialized
20 LL |     let c1 = || match x { };
21    |                       ^ `x` used here but it isn't initialized
22
23 error[E0381]: used binding `x` isn't initialized
24   --> $DIR/pattern-matching-should-fail.rs:15:14
25    |
26 LL |     let x: !;
27    |         - binding declared here but left uninitialized
28 LL |     let c2 = || match x { _ => () };
29    |              ^^       - borrow occurs due to use in closure
30    |              |
31    |              `x` used here but it isn't initialized
32
33 error[E0381]: used binding `variant` isn't initialized
34   --> $DIR/pattern-matching-should-fail.rs:27:13
35    |
36 LL |     let variant: !;
37    |         ------- binding declared here but left uninitialized
38 LL |     let c = || {
39    |             ^^ `variant` used here but it isn't initialized
40 LL |
41 LL |         match variant {
42    |               ------- borrow occurs due to use in closure
43
44 error[E0381]: used binding `variant` isn't initialized
45   --> $DIR/pattern-matching-should-fail.rs:39:13
46    |
47 LL |     let variant: !;
48    |         ------- binding declared here but left uninitialized
49 LL |     let c = || {
50    |             ^^ `variant` used here but it isn't initialized
51 LL |         match variant {
52    |               ------- borrow occurs due to use in closure
53
54 error[E0381]: used binding `g` isn't initialized
55   --> $DIR/pattern-matching-should-fail.rs:54:15
56    |
57 LL |     let g: !;
58    |         - binding declared here but left uninitialized
59 ...
60 LL |         match g { };
61    |               ^ `g` used here but it isn't initialized
62
63 error[E0381]: used binding `t` isn't initialized
64   --> $DIR/pattern-matching-should-fail.rs:56:19
65    |
66 LL |     let t: !;
67    |         - binding declared here but left uninitialized
68 ...
69 LL |             match t { };
70    |                   ^ `t` used here but it isn't initialized
71
72 error[E0381]: used binding `x` isn't initialized
73   --> $DIR/pattern-matching-should-fail.rs:67:23
74    |
75 LL |     let x: u8;
76    |         - binding declared here but left uninitialized
77 LL |     let c1 = || match x { };
78    |                       ^ `x` used here but it isn't initialized
79    |
80 help: consider assigning a value
81    |
82 LL |     let x: u8 = 0;
83    |               +++
84
85 error: aborting due to 8 previous errors
86
87 Some errors have detailed explanations: E0004, E0381.
88 For more information about an error, try `rustc --explain E0004`.