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