2022-09-02 22:01:35 -05:00
error[E0004]: non-exhaustive patterns: `E::B` and `E::C` not covered
2022-12-23 14:02:23 -06:00
--> $DIR/non-exhaustive-defined-here.rs:35:11
2021-12-15 23:06:44 -06:00
|
LL | match e1 {
2022-09-02 22:01:35 -05:00
| ^^ patterns `E::B` and `E::C` not covered
2021-12-15 23:06:44 -06:00
|
note: `E` defined here
--> $DIR/non-exhaustive-defined-here.rs:14:5
2019-09-07 17:55:38 -05:00
|
2021-12-15 23:06:44 -06:00
LL | enum E {
| -
...
LL | B,
| ^ not covered
...
LL | C
| ^ not covered
2020-03-27 00:44:30 -05:00
= note: the matched value is of type `E`
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, a match arm with multiple or-patterns as shown, or multiple match arms
2021-12-15 20:14:17 -06:00
|
2023-02-27 11:43:39 -06:00
LL ~ E::A => {},
2022-09-02 22:01:35 -05:00
LL + E::B | E::C => todo!()
2021-12-15 20:14:17 -06:00
|
2019-09-07 17:55:38 -05:00
2022-12-23 14:02:23 -06:00
error[E0005]: refutable pattern in local binding
--> $DIR/non-exhaustive-defined-here.rs:41:9
2021-12-15 23:06:44 -06:00
|
LL | let E::A = e;
2022-09-02 22:01:35 -05:00
| ^^^^ patterns `E::B` and `E::C` not covered
2019-10-09 14:25:48 -05:00
|
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
2021-12-15 23:06:44 -06:00
note: `E` defined here
2022-12-23 14:02:23 -06:00
--> $DIR/non-exhaustive-defined-here.rs:6:6
2021-12-15 23:06:44 -06:00
|
LL | enum E {
2022-12-23 14:02:23 -06:00
| ^
2021-12-15 23:06:44 -06:00
...
LL | B,
2022-12-23 14:02:23 -06:00
| - not covered
2021-12-15 23:06:44 -06:00
...
LL | C
2022-12-23 14:02:23 -06:00
| - not covered
2020-03-27 00:44:30 -05:00
= note: the matched value is of type `E`
2022-03-07 23:54:38 -06:00
help: you might want to use `if let` to ignore the variants that aren't matched
|
2023-02-27 11:43:39 -06:00
LL | if let E::A = e { todo!() };
| ++ +++++++++++
2019-09-07 17:55:38 -05:00
2022-09-02 22:01:35 -05:00
error[E0004]: non-exhaustive patterns: `&E::B` and `&E::C` not covered
2022-12-23 14:02:23 -06:00
--> $DIR/non-exhaustive-defined-here.rs:50:11
2021-12-15 23:06:44 -06:00
|
LL | match e {
2022-09-02 22:01:35 -05:00
| ^ patterns `&E::B` and `&E::C` not covered
2019-09-07 17:55:38 -05:00
|
2021-12-15 23:06:44 -06:00
note: `E` defined here
--> $DIR/non-exhaustive-defined-here.rs:14:5
|
LL | enum E {
| -
...
LL | B,
| ^ not covered
...
LL | C
| ^ not covered
2020-03-27 00:44:30 -05:00
= note: the matched value is of type `&E`
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, a match arm with multiple or-patterns as shown, or multiple match arms
2021-12-15 20:14:17 -06:00
|
2023-02-27 11:43:39 -06:00
LL ~ E::A => {},
2022-09-02 22:01:35 -05:00
LL + &E::B | &E::C => todo!()
2021-12-15 20:14:17 -06:00
|
2019-09-07 17:55:38 -05:00
2022-12-23 14:02:23 -06:00
error[E0005]: refutable pattern in local binding
--> $DIR/non-exhaustive-defined-here.rs:57:9
2019-09-07 17:55:38 -05:00
|
2021-12-15 23:06:44 -06:00
LL | let E::A = e;
2022-09-02 22:01:35 -05:00
| ^^^^ patterns `&E::B` and `&E::C` not covered
2019-10-09 14:25:48 -05:00
|
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
2021-12-15 23:06:44 -06:00
note: `E` defined here
2022-12-23 14:02:23 -06:00
--> $DIR/non-exhaustive-defined-here.rs:6:6
2021-12-15 23:06:44 -06:00
|
LL | enum E {
2022-12-23 14:02:23 -06:00
| ^
2021-12-15 23:06:44 -06:00
...
LL | B,
2022-12-23 14:02:23 -06:00
| - not covered
2021-12-15 23:06:44 -06:00
...
LL | C
2022-12-23 14:02:23 -06:00
| - not covered
2020-03-27 00:44:30 -05:00
= note: the matched value is of type `&E`
2022-03-07 23:54:38 -06:00
help: you might want to use `if let` to ignore the variants that aren't matched
2019-10-09 14:25:48 -05:00
|
2023-02-27 11:43:39 -06:00
LL | if let E::A = e { todo!() };
| ++ +++++++++++
2019-09-07 17:55:38 -05:00
2022-09-02 22:01:35 -05:00
error[E0004]: non-exhaustive patterns: `&&mut &E::B` and `&&mut &E::C` not covered
2021-12-15 23:06:44 -06:00
--> $DIR/non-exhaustive-defined-here.rs:66:11
|
LL | match e {
2022-09-02 22:01:35 -05:00
| ^ patterns `&&mut &E::B` and `&&mut &E::C` not covered
2019-09-07 17:55:38 -05:00
|
2021-12-15 23:06:44 -06:00
note: `E` defined here
--> $DIR/non-exhaustive-defined-here.rs:14:5
|
LL | enum E {
| -
...
LL | B,
| ^ not covered
...
LL | C
| ^ not covered
2020-03-27 00:44:30 -05:00
= note: the matched value is of type `&&mut &E`
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, a match arm with multiple or-patterns as shown, or multiple match arms
2021-12-15 20:14:17 -06:00
|
2023-02-27 11:43:39 -06:00
LL ~ E::A => {},
2022-09-02 22:01:35 -05:00
LL + &&mut &E::B | &&mut &E::C => todo!()
2021-12-15 20:14:17 -06:00
|
2019-09-07 17:55:38 -05:00
2022-12-23 14:02:23 -06:00
error[E0005]: refutable pattern in local binding
--> $DIR/non-exhaustive-defined-here.rs:73:9
2021-12-15 23:06:44 -06:00
|
LL | let E::A = e;
2022-09-02 22:01:35 -05:00
| ^^^^ patterns `&&mut &E::B` and `&&mut &E::C` not covered
2019-10-09 14:25:48 -05:00
|
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
2021-12-15 23:06:44 -06:00
note: `E` defined here
2022-12-23 14:02:23 -06:00
--> $DIR/non-exhaustive-defined-here.rs:6:6
2021-12-15 23:06:44 -06:00
|
LL | enum E {
2022-12-23 14:02:23 -06:00
| ^
2021-12-15 23:06:44 -06:00
...
LL | B,
2022-12-23 14:02:23 -06:00
| - not covered
2021-12-15 23:06:44 -06:00
...
LL | C
2022-12-23 14:02:23 -06:00
| - not covered
2020-03-27 00:44:30 -05:00
= note: the matched value is of type `&&mut &E`
2022-03-07 23:54:38 -06:00
help: you might want to use `if let` to ignore the variants that aren't matched
2019-10-09 14:25:48 -05:00
|
2023-02-27 11:43:39 -06:00
LL | if let E::A = e { todo!() };
| ++ +++++++++++
2019-09-07 17:55:38 -05:00
2022-09-02 22:01:35 -05:00
error[E0004]: non-exhaustive patterns: `Opt::None` not covered
2021-12-15 23:06:44 -06:00
--> $DIR/non-exhaustive-defined-here.rs:92:11
|
LL | match e {
2022-09-02 22:01:35 -05:00
| ^ pattern `Opt::None` not covered
2019-09-07 17:55:38 -05:00
|
2021-12-15 23:06:44 -06:00
note: `Opt` defined here
2022-12-23 14:02:23 -06:00
--> $DIR/non-exhaustive-defined-here.rs:85:5
2021-12-15 23:06:44 -06:00
|
LL | enum Opt {
| ---
...
LL | None,
| ^^^^ not covered
2020-03-27 00:44:30 -05:00
= note: the matched value is of type `Opt`
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 or an explicit pattern as shown
2021-12-15 20:14:17 -06:00
|
2023-02-27 11:43:39 -06:00
LL ~ Opt::Some(ref _x) => {},
2022-09-02 22:01:35 -05:00
LL + Opt::None => todo!()
2021-12-15 20:14:17 -06:00
|
2019-09-07 17:55:38 -05:00
2022-12-23 14:02:23 -06:00
error[E0005]: refutable pattern in local binding
--> $DIR/non-exhaustive-defined-here.rs:99:9
2021-12-15 23:06:44 -06:00
|
LL | let Opt::Some(ref _x) = e;
2022-09-02 22:01:35 -05:00
| ^^^^^^^^^^^^^^^^^ pattern `Opt::None` not covered
2019-10-09 14:25:48 -05:00
|
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
2021-12-15 23:06:44 -06:00
note: `Opt` defined here
2022-12-23 14:02:23 -06:00
--> $DIR/non-exhaustive-defined-here.rs:81:6
2021-12-15 23:06:44 -06:00
|
LL | enum Opt {
2022-12-23 14:02:23 -06:00
| ^^^
2021-12-15 23:06:44 -06:00
...
LL | None,
2022-12-23 14:02:23 -06:00
| ---- not covered
2020-03-27 00:44:30 -05:00
= note: the matched value is of type `Opt`
2022-12-23 15:23:37 -06:00
help: you might want to use `let else` to handle the variant that isn't matched
2022-03-07 23:54:38 -06:00
|
LL | let Opt::Some(ref _x) = e else { todo!() };
| ++++++++++++++++
2019-09-07 17:55:38 -05:00
error: aborting due to 8 previous errors
Some errors have detailed explanations: E0004, E0005.
For more information about an error, try `rustc --explain E0004`.