]> git.proxmox.com Git - rustc.git/blob - tests/ui/uninhabited/uninhabited-matches-feature-gated.stderr
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / uninhabited / uninhabited-matches-feature-gated.stderr
1 error[E0004]: non-exhaustive patterns: `Err(_)` not covered
2 --> $DIR/uninhabited-matches-feature-gated.rs:6:19
3 |
4 LL | let _ = match x {
5 | ^ pattern `Err(_)` not covered
6 |
7 note: `Result<u32, &Void>` defined here
8 --> $SRC_DIR/core/src/result.rs:LL:COL
9 ::: $SRC_DIR/core/src/result.rs:LL:COL
10 |
11 = note: not covered
12 = note: the matched value is of type `Result<u32, &Void>`
13 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
14 |
15 LL ~ Ok(n) => n,
16 LL ~ Err(_) => todo!(),
17 |
18
19 error[E0004]: non-exhaustive patterns: type `&Void` is non-empty
20 --> $DIR/uninhabited-matches-feature-gated.rs:15:19
21 |
22 LL | let _ = match x {};
23 | ^
24 |
25 note: `Void` defined here
26 --> $DIR/uninhabited-matches-feature-gated.rs:2:6
27 |
28 LL | enum Void {}
29 | ^^^^
30 = note: the matched value is of type `&Void`
31 = note: references are always considered inhabited
32 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
33 |
34 LL ~ let _ = match x {
35 LL + _ => todo!(),
36 LL ~ };
37 |
38
39 error[E0004]: non-exhaustive patterns: type `(Void,)` is non-empty
40 --> $DIR/uninhabited-matches-feature-gated.rs:18:19
41 |
42 LL | let _ = match x {};
43 | ^
44 |
45 = note: the matched value is of type `(Void,)`
46 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
47 |
48 LL ~ let _ = match x {
49 LL + _ => todo!(),
50 LL ~ };
51 |
52
53 error[E0004]: non-exhaustive patterns: type `[Void; 1]` is non-empty
54 --> $DIR/uninhabited-matches-feature-gated.rs:21:19
55 |
56 LL | let _ = match x {};
57 | ^
58 |
59 = note: the matched value is of type `[Void; 1]`
60 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
61 |
62 LL ~ let _ = match x {
63 LL + _ => todo!(),
64 LL ~ };
65 |
66
67 error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered
68 --> $DIR/uninhabited-matches-feature-gated.rs:24:19
69 |
70 LL | let _ = match x {
71 | ^ pattern `&[_, ..]` not covered
72 |
73 = note: the matched value is of type `&[Void]`
74 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
75 |
76 LL ~ &[] => (),
77 LL ~ &[_, ..] => todo!(),
78 |
79
80 error[E0004]: non-exhaustive patterns: `Err(_)` not covered
81 --> $DIR/uninhabited-matches-feature-gated.rs:32:19
82 |
83 LL | let _ = match x {
84 | ^ pattern `Err(_)` not covered
85 |
86 note: `Result<u32, Void>` defined here
87 --> $SRC_DIR/core/src/result.rs:LL:COL
88 ::: $SRC_DIR/core/src/result.rs:LL:COL
89 |
90 = note: not covered
91 = note: the matched value is of type `Result<u32, Void>`
92 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
93 |
94 LL ~ Ok(x) => x,
95 LL ~ Err(_) => todo!(),
96 |
97
98 error[E0005]: refutable pattern in local binding
99 --> $DIR/uninhabited-matches-feature-gated.rs:37:9
100 |
101 LL | let Ok(x) = x;
102 | ^^^^^ pattern `Err(_)` not covered
103 |
104 = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
105 = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
106 = note: the matched value is of type `Result<u32, Void>`
107 help: you might want to use `let else` to handle the variant that isn't matched
108 |
109 LL | let Ok(x) = x else { todo!() };
110 | ++++++++++++++++
111
112 error: aborting due to 7 previous errors
113
114 Some errors have detailed explanations: E0004, E0005.
115 For more information about an error, try `rustc --explain E0004`.