fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.8 KiB115 linesraw
1error[E0004]: non-exhaustive patterns: `Err(_)` not covered
2  --> $DIR/uninhabited-matches-feature-gated.rs:6:19
3   |
4LL |     let _ = match x {
5   |                   ^ pattern `Err(_)` not covered
6   |
7note: `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>`
13help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
14   |
15LL ~         Ok(n) => n,
16LL ~         Err(_) => todo!(),
17   |
18
19error[E0004]: non-exhaustive patterns: type `&Void` is non-empty
20  --> $DIR/uninhabited-matches-feature-gated.rs:15:19
21   |
22LL |     let _ = match x {};
23   |                   ^
24   |
25note: `Void` defined here
26  --> $DIR/uninhabited-matches-feature-gated.rs:2:6
27   |
28LL | enum Void {}
29   |      ^^^^
30   = note: the matched value is of type `&Void`
31   = note: references are always considered inhabited
32help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
33   |
34LL ~     let _ = match x {
35LL +         _ => todo!(),
36LL ~     };
37   |
38
39error[E0004]: non-exhaustive patterns: type `(Void,)` is non-empty
40  --> $DIR/uninhabited-matches-feature-gated.rs:18:19
41   |
42LL |     let _ = match x {};
43   |                   ^
44   |
45   = note: the matched value is of type `(Void,)`
46help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
47   |
48LL ~     let _ = match x {
49LL +         _ => todo!(),
50LL ~     };
51   |
52
53error[E0004]: non-exhaustive patterns: type `[Void; 1]` is non-empty
54  --> $DIR/uninhabited-matches-feature-gated.rs:21:19
55   |
56LL |     let _ = match x {};
57   |                   ^
58   |
59   = note: the matched value is of type `[Void; 1]`
60help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
61   |
62LL ~     let _ = match x {
63LL +         _ => todo!(),
64LL ~     };
65   |
66
67error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered
68  --> $DIR/uninhabited-matches-feature-gated.rs:24:19
69   |
70LL |     let _ = match x {
71   |                   ^ pattern `&[_, ..]` not covered
72   |
73   = note: the matched value is of type `&[Void]`
74help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
75   |
76LL ~         &[] => (),
77LL ~         &[_, ..] => todo!(),
78   |
79
80error[E0004]: non-exhaustive patterns: `Err(_)` not covered
81  --> $DIR/uninhabited-matches-feature-gated.rs:32:19
82   |
83LL |     let _ = match x {
84   |                   ^ pattern `Err(_)` not covered
85   |
86note: `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>`
92help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
93   |
94LL ~         Ok(x) => x,
95LL ~         Err(_) => todo!(),
96   |
97
98error[E0005]: refutable pattern in local binding
99  --> $DIR/uninhabited-matches-feature-gated.rs:37:9
100   |
101LL |     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>`
107help: you might want to use `let else` to handle the variant that isn't matched
108   |
109LL |     let Ok(x) = x else { todo!() };
110   |                   ++++++++++++++++
111
112error: aborting due to 7 previous errors
113
114Some errors have detailed explanations: E0004, E0005.
115For more information about an error, try `rustc --explain E0004`.