2021-02-25 17:03:41 -06:00
|
|
|
error[E0004]: non-exhaustive patterns: type `u8` is non-empty
|
2022-06-21 13:57:45 -05:00
|
|
|
--> $DIR/pattern-matching-should-fail.rs:67:23
|
2021-02-25 17:03:41 -06:00
|
|
|
|
|
|
|
|
LL | let c1 = || match x { };
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
= note: the matched value is of type `u8`
|
2021-12-16 16:46:13 -06:00
|
|
|
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
2021-12-15 20:05:58 -06:00
|
|
|
|
|
|
|
|
LL ~ let c1 = || match x {
|
|
|
|
LL + _ => todo!(),
|
|
|
|
LL ~ };
|
|
|
|
|
|
2021-02-25 17:03:41 -06:00
|
|
|
|
2022-06-21 17:54:17 -05:00
|
|
|
error[E0381]: used binding `x` isn't initialized
|
2021-06-27 01:22:46 -05:00
|
|
|
--> $DIR/pattern-matching-should-fail.rs:8:23
|
2021-02-25 17:03:41 -06:00
|
|
|
|
|
2022-06-21 13:57:45 -05:00
|
|
|
LL | let x: !;
|
2022-06-21 17:54:17 -05:00
|
|
|
| - binding declared here but left uninitialized
|
2021-02-25 17:03:41 -06:00
|
|
|
LL | let c1 = || match x { };
|
2022-06-21 13:57:45 -05:00
|
|
|
| ^ `x` used here but it isn't initialized
|
2021-02-25 17:03:41 -06:00
|
|
|
|
2022-06-21 17:54:17 -05:00
|
|
|
error[E0381]: used binding `x` isn't initialized
|
2021-06-27 01:22:46 -05:00
|
|
|
--> $DIR/pattern-matching-should-fail.rs:15:14
|
2021-02-25 17:03:41 -06:00
|
|
|
|
|
2022-06-21 13:57:45 -05:00
|
|
|
LL | let x: !;
|
2022-06-21 17:54:17 -05:00
|
|
|
| - binding declared here but left uninitialized
|
2021-02-25 17:03:41 -06:00
|
|
|
LL | let c2 = || match x { _ => () };
|
|
|
|
| ^^ - borrow occurs due to use in closure
|
|
|
|
| |
|
2022-06-21 17:54:17 -05:00
|
|
|
| `x` used here but it isn't initialized
|
2021-02-25 17:03:41 -06:00
|
|
|
|
2022-06-21 17:54:17 -05:00
|
|
|
error[E0381]: used binding `variant` isn't initialized
|
2021-06-27 01:22:46 -05:00
|
|
|
--> $DIR/pattern-matching-should-fail.rs:27:13
|
2021-02-25 17:03:41 -06:00
|
|
|
|
|
2022-06-21 13:57:45 -05:00
|
|
|
LL | let variant: !;
|
2022-06-21 17:54:17 -05:00
|
|
|
| ------- binding declared here but left uninitialized
|
2021-02-25 17:03:41 -06:00
|
|
|
LL | let c = || {
|
2022-06-21 17:54:17 -05:00
|
|
|
| ^^ `variant` used here but it isn't initialized
|
2021-02-25 17:03:41 -06:00
|
|
|
LL |
|
|
|
|
LL | match variant {
|
|
|
|
| ------- borrow occurs due to use in closure
|
|
|
|
|
2022-06-21 17:54:17 -05:00
|
|
|
error[E0381]: used binding `variant` isn't initialized
|
2021-06-27 01:22:46 -05:00
|
|
|
--> $DIR/pattern-matching-should-fail.rs:39:13
|
2021-02-25 17:03:41 -06:00
|
|
|
|
|
2022-06-21 13:57:45 -05:00
|
|
|
LL | let variant: !;
|
2022-06-21 17:54:17 -05:00
|
|
|
| ------- binding declared here but left uninitialized
|
2021-02-25 17:03:41 -06:00
|
|
|
LL | let c = || {
|
2022-06-21 17:54:17 -05:00
|
|
|
| ^^ `variant` used here but it isn't initialized
|
2021-02-25 17:03:41 -06:00
|
|
|
LL | match variant {
|
|
|
|
| ------- borrow occurs due to use in closure
|
|
|
|
|
2022-06-21 17:54:17 -05:00
|
|
|
error[E0381]: used binding `g` isn't initialized
|
2022-06-21 13:57:45 -05:00
|
|
|
--> $DIR/pattern-matching-should-fail.rs:54:15
|
2021-02-25 17:03:41 -06:00
|
|
|
|
|
2022-06-21 13:57:45 -05:00
|
|
|
LL | let g: !;
|
2022-06-21 17:54:17 -05:00
|
|
|
| - binding declared here but left uninitialized
|
2022-06-21 13:57:45 -05:00
|
|
|
...
|
2021-02-25 17:03:41 -06:00
|
|
|
LL | match g { };
|
2022-06-21 13:57:45 -05:00
|
|
|
| ^ `g` used here but it isn't initialized
|
2021-02-25 17:03:41 -06:00
|
|
|
|
2022-06-21 17:54:17 -05:00
|
|
|
error[E0381]: used binding `t` isn't initialized
|
2022-06-21 13:57:45 -05:00
|
|
|
--> $DIR/pattern-matching-should-fail.rs:56:19
|
2021-02-25 17:03:41 -06:00
|
|
|
|
|
2022-06-21 13:57:45 -05:00
|
|
|
LL | let t: !;
|
2022-06-21 17:54:17 -05:00
|
|
|
| - binding declared here but left uninitialized
|
2022-06-21 13:57:45 -05:00
|
|
|
...
|
2021-02-25 17:03:41 -06:00
|
|
|
LL | match t { };
|
2022-06-21 13:57:45 -05:00
|
|
|
| ^ `t` used here but it isn't initialized
|
2021-02-25 17:03:41 -06:00
|
|
|
|
2022-06-21 17:54:17 -05:00
|
|
|
error[E0381]: used binding `x` isn't initialized
|
2022-06-21 13:57:45 -05:00
|
|
|
--> $DIR/pattern-matching-should-fail.rs:67:23
|
2021-02-25 17:03:41 -06:00
|
|
|
|
|
2022-06-21 13:57:45 -05:00
|
|
|
LL | let x: u8;
|
2022-06-21 17:54:17 -05:00
|
|
|
| - binding declared here but left uninitialized
|
2021-02-25 17:03:41 -06:00
|
|
|
LL | let c1 = || match x { };
|
2022-06-21 13:57:45 -05:00
|
|
|
| ^ `x` used here but it isn't initialized
|
2022-09-23 02:28:48 -05:00
|
|
|
|
|
|
|
|
help: consider assigning a value
|
|
|
|
|
|
|
|
|
LL | let x: u8 = 0;
|
|
|
|
| +++
|
2021-02-25 17:03:41 -06:00
|
|
|
|
2021-06-27 01:22:46 -05:00
|
|
|
error: aborting due to 8 previous errors
|
2021-02-25 17:03:41 -06:00
|
|
|
|
|
|
|
Some errors have detailed explanations: E0004, E0381.
|
|
|
|
For more information about an error, try `rustc --explain E0004`.
|