2021-08-23 21:41:03 -05:00
|
|
|
error[E0004]: non-exhaustive patterns: `B` not covered
|
|
|
|
--> $DIR/non-exhaustive-match.rs:26:25
|
|
|
|
|
|
|
|
|
LL | let _b = || { match l1 { L1::A => () } };
|
|
|
|
| ^^ pattern `B` not covered
|
|
|
|
|
|
2021-12-15 23:06:44 -06:00
|
|
|
note: `L1` defined here
|
|
|
|
--> $DIR/non-exhaustive-match.rs:12:14
|
|
|
|
|
|
|
|
|
LL | enum L1 { A, B }
|
|
|
|
| -- ^ not covered
|
2021-08-23 21:41:03 -05:00
|
|
|
= note: the matched value is of type `L1`
|
2021-12-15 20:14:17 -06:00
|
|
|
help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
|
|
|
|
|
|
|
|
|
LL | let _b = || { match l1 { L1::A => (), B => todo!() } };
|
|
|
|
| ++++++++++++++
|
2021-08-23 21:41:03 -05:00
|
|
|
|
|
|
|
error[E0004]: non-exhaustive patterns: type `E1` is non-empty
|
|
|
|
--> $DIR/non-exhaustive-match.rs:37:25
|
|
|
|
|
|
|
|
|
LL | let _d = || { match e1 {} };
|
|
|
|
| ^^
|
|
|
|
|
|
2021-12-15 23:06:44 -06:00
|
|
|
note: `E1` defined here
|
|
|
|
--> $DIR/auxiliary/match_non_exhaustive_lib.rs:2:1
|
|
|
|
|
|
|
|
|
LL | pub enum E1 {}
|
|
|
|
| ^^^^^^^^^^^^^^
|
2021-08-23 21:41:03 -05:00
|
|
|
= note: the matched value is of type `E1`, which is marked as non-exhaustive
|
2021-12-15 20:05:58 -06:00
|
|
|
help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
|
|
|
|
|
|
|
|
|
LL ~ let _d = || { match e1 {
|
|
|
|
LL + _ => todo!(),
|
|
|
|
LL ~ } };
|
|
|
|
|
|
2021-08-23 21:41:03 -05:00
|
|
|
|
|
|
|
error[E0004]: non-exhaustive patterns: `_` not covered
|
|
|
|
--> $DIR/non-exhaustive-match.rs:39:25
|
|
|
|
|
|
|
|
|
LL | let _e = || { match e2 { E2::A => (), E2::B => () } };
|
|
|
|
| ^^ pattern `_` not covered
|
|
|
|
|
|
2021-12-15 23:06:44 -06:00
|
|
|
note: `E2` defined here
|
|
|
|
--> $DIR/auxiliary/match_non_exhaustive_lib.rs:5:1
|
|
|
|
|
|
|
|
|
LL | pub enum E2 { A, B }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
2021-08-23 21:41:03 -05:00
|
|
|
= note: the matched value is of type `E2`, which is marked as non-exhaustive
|
2021-12-15 20:28:09 -06:00
|
|
|
help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
|
|
|
|
|
|
|
|
|
LL | let _e = || { match e2 { E2::A => (), E2::B => (), _ => todo!() } };
|
|
|
|
| ++++++++++++++
|
2021-08-23 21:41:03 -05:00
|
|
|
|
|
|
|
error[E0505]: cannot move out of `e3` because it is borrowed
|
|
|
|
--> $DIR/non-exhaustive-match.rs:46:22
|
|
|
|
|
|
|
|
|
LL | let _g = || { match e3 { E3::C => (), _ => () } };
|
|
|
|
| -- -- borrow occurs due to use in closure
|
|
|
|
| |
|
|
|
|
| borrow of `e3` occurs here
|
|
|
|
LL | let mut mut_e3 = e3;
|
|
|
|
| ^^ move out of `e3` occurs here
|
|
|
|
LL |
|
|
|
|
LL | _g();
|
|
|
|
| -- borrow later used here
|
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
|
|
|
|
Some errors have detailed explanations: E0004, E0505.
|
|
|
|
For more information about an error, try `rustc --explain E0004`.
|