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