File: match_non_exhaustive.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (57 lines) | stat: -rw-r--r-- 1,952 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
error[E0004]: non-exhaustive patterns: `L::B` not covered
  --> $DIR/match_non_exhaustive.rs:23:11
   |
LL |     match l { L::A => () };
   |           ^ pattern `L::B` not covered
   |
note: `L` defined here
  --> $DIR/match_non_exhaustive.rs:10:6
   |
LL | enum L { A, B }
   |      ^      - not covered
   = note: the matched value is of type `L`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
   |
LL |     match l { L::A => (), L::B => todo!() };
   |                         +++++++++++++++++

error[E0004]: non-exhaustive patterns: type `E1` is non-empty
  --> $DIR/match_non_exhaustive.rs:28:11
   |
LL |     match e1 {};
   |           ^^
   |
note: `E1` defined here
  --> $DIR/auxiliary/match_non_exhaustive_lib.rs:2:1
   |
LL | pub enum E1 {}
   | ^^^^^^^^^^^
   = note: the matched value is of type `E1`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
   |
LL ~     match e1 {
LL +         _ => todo!(),
LL ~     };
   |

error[E0004]: non-exhaustive patterns: `_` not covered
  --> $DIR/match_non_exhaustive.rs:30:11
   |
LL |     match e2 { E2::A => (), E2::B => () };
   |           ^^ pattern `_` not covered
   |
note: `E2` defined here
  --> $DIR/auxiliary/match_non_exhaustive_lib.rs:5:1
   |
LL | pub enum E2 { A, B }
   | ^^^^^^^^^^^
   = note: the matched value is of type `E2`
   = note: `E2` is marked as non-exhaustive, so a wildcard `_` is necessary to match exhaustively
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
   |
LL |     match e2 { E2::A => (), E2::B => (), _ => todo!() };
   |                                        ++++++++++++++

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0004`.