]> git.proxmox.com Git - rustc.git/blame - src/test/ui/pattern/usefulness/non-exhaustive-match.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / pattern / usefulness / non-exhaustive-match.stderr
CommitLineData
0731742a 1error[E0004]: non-exhaustive patterns: `A` not covered
dfeec247 2 --> $DIR/non-exhaustive-match.rs:7:11
b7449926 3 |
532ac7d7 4LL | match x { T::B => { } }
0731742a 5 | ^ pattern `A` not covered
532ac7d7 6 |
5e7ed085
FG
7note: `T` defined here
8 --> $DIR/non-exhaustive-match.rs:3:10
9 |
10LL | enum T { A, B }
11 | - ^ not covered
ba9703b0 12 = note: the matched value is of type `T`
5e7ed085
FG
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 |
923072b8
FG
15LL | match x { T::B => { }, A => todo!() }
16 | ++++++++++++++
b7449926
XL
17
18error[E0004]: non-exhaustive patterns: `false` not covered
dfeec247 19 --> $DIR/non-exhaustive-match.rs:8:11
b7449926 20 |
532ac7d7 21LL | match true {
b7449926 22 | ^^^^ pattern `false` not covered
532ac7d7 23 |
ba9703b0 24 = note: the matched value is of type `bool`
5e7ed085
FG
25help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
26 |
27LL ~ true => {}
28LL + false => todo!()
29 |
b7449926
XL
30
31error[E0004]: non-exhaustive patterns: `Some(_)` not covered
dfeec247 32 --> $DIR/non-exhaustive-match.rs:11:11
b7449926 33 |
532ac7d7 34LL | match Some(10) {
b7449926 35 | ^^^^^^^^ pattern `Some(_)` not covered
94222f64 36 |
5e7ed085
FG
37note: `Option<i32>` defined here
38 --> $SRC_DIR/core/src/option.rs:LL:COL
39 |
40LL | / pub enum Option<T> {
41LL | | /// No value.
42LL | | #[lang = "None"]
43LL | | #[stable(feature = "rust1", since = "1.0.0")]
44... |
45LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
46 | | ^^^^ not covered
47LL | | }
48 | |_-
49 = note: the matched value is of type `Option<i32>`
50help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
ba9703b0 51 |
5e7ed085
FG
52LL ~ None => {}
53LL + Some(_) => todo!()
532ac7d7 54 |
b7449926 55
f035d41b 56error[E0004]: non-exhaustive patterns: `(_, _, i32::MIN..=3_i32)` and `(_, _, 5_i32..=i32::MAX)` not covered
dfeec247 57 --> $DIR/non-exhaustive-match.rs:14:11
b7449926 58 |
532ac7d7 59LL | match (2, 3, 4) {
f035d41b 60 | ^^^^^^^^^ patterns `(_, _, i32::MIN..=3_i32)` and `(_, _, 5_i32..=i32::MAX)` not covered
532ac7d7 61 |
ba9703b0 62 = note: the matched value is of type `(i32, i32, i32)`
5e7ed085
FG
63help: 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
64 |
65LL ~ (_, _, 4) => {}
66LL + (_, _, i32::MIN..=3_i32) | (_, _, 5_i32..=i32::MAX) => todo!()
67 |
b7449926 68
fc512014 69error[E0004]: non-exhaustive patterns: `(A, A)` and `(B, B)` not covered
dfeec247 70 --> $DIR/non-exhaustive-match.rs:18:11
b7449926 71 |
532ac7d7 72LL | match (T::A, T::A) {
fc512014 73 | ^^^^^^^^^^^^ patterns `(A, A)` and `(B, B)` not covered
532ac7d7 74 |
ba9703b0 75 = note: the matched value is of type `(T, T)`
5e7ed085
FG
76help: 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
77 |
78LL ~ (T::B, T::A) => {}
79LL + (A, A) | (B, B) => todo!()
80 |
b7449926 81
0731742a 82error[E0004]: non-exhaustive patterns: `B` not covered
dfeec247 83 --> $DIR/non-exhaustive-match.rs:22:11
b7449926 84 |
532ac7d7 85LL | match T::A {
0731742a 86 | ^^^^ pattern `B` not covered
532ac7d7 87 |
5e7ed085
FG
88note: `T` defined here
89 --> $DIR/non-exhaustive-match.rs:3:13
90 |
91LL | enum T { A, B }
92 | - ^ not covered
ba9703b0 93 = note: the matched value is of type `T`
5e7ed085
FG
94help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
95 |
96LL ~ T::A => {}
97LL + B => todo!()
98 |
b7449926
XL
99
100error[E0004]: non-exhaustive patterns: `[]` not covered
dfeec247 101 --> $DIR/non-exhaustive-match.rs:33:11
b7449926 102 |
532ac7d7 103LL | match *vec {
b7449926 104 | ^^^^ pattern `[]` not covered
532ac7d7 105 |
1b1a35ee 106 = note: the matched value is of type `[Option<isize>]`
5e7ed085
FG
107help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
108 |
109LL ~ [None] => {}
110LL + [] => todo!()
111 |
b7449926 112
60c5eb7d 113error[E0004]: non-exhaustive patterns: `[_, _, _, _, ..]` not covered
dfeec247 114 --> $DIR/non-exhaustive-match.rs:46:11
b7449926 115 |
532ac7d7 116LL | match *vec {
60c5eb7d 117 | ^^^^ pattern `[_, _, _, _, ..]` not covered
532ac7d7 118 |
ba9703b0 119 = note: the matched value is of type `[f32]`
5e7ed085
FG
120help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
121 |
122LL ~ [] => (),
123LL + [_, _, _, _, ..] => todo!()
124 |
b7449926
XL
125
126error: aborting due to 8 previous errors
127
128For more information about this error, try `rustc --explain E0004`.