]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-match-check.matchck.stderr
f89bbc0d42234447a3d195300f54c8165cf26679
[rust.git] / src / test / ui / consts / const-match-check.matchck.stderr
1 error[E0005]: refutable pattern in local binding: `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
2   --> $DIR/const-match-check.rs:4:22
3    |
4 LL | const X: i32 = { let 0 = 0; 0 };
5    |                      ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
6    |
7    = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
8    = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
9    = note: the matched value is of type `i32`
10 help: you might want to use `if let` to ignore the variants that aren't matched
11    |
12 LL | const X: i32 = { if let 0 = 0 { todo!() } 0 };
13    |                  ++           ~~~~~~~~~~~
14 help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
15    |
16 LL | const X: i32 = { let 0 = 0 else { todo!() }; 0 };
17    |                            ++++++++++++++++
18
19 error[E0005]: refutable pattern in local binding: `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
20   --> $DIR/const-match-check.rs:8:23
21    |
22 LL | static Y: i32 = { let 0 = 0; 0 };
23    |                       ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
24    |
25    = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
26    = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
27    = note: the matched value is of type `i32`
28 help: you might want to use `if let` to ignore the variants that aren't matched
29    |
30 LL | static Y: i32 = { if let 0 = 0 { todo!() } 0 };
31    |                   ++           ~~~~~~~~~~~
32 help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
33    |
34 LL | static Y: i32 = { let 0 = 0 else { todo!() }; 0 };
35    |                             ++++++++++++++++
36
37 error[E0005]: refutable pattern in local binding: `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
38   --> $DIR/const-match-check.rs:13:26
39    |
40 LL |     const X: i32 = { let 0 = 0; 0 };
41    |                          ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
42    |
43    = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
44    = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
45    = note: the matched value is of type `i32`
46 help: you might want to use `if let` to ignore the variants that aren't matched
47    |
48 LL |     const X: i32 = { if let 0 = 0 { todo!() } 0 };
49    |                      ++           ~~~~~~~~~~~
50 help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
51    |
52 LL |     const X: i32 = { let 0 = 0 else { todo!() }; 0 };
53    |                                ++++++++++++++++
54
55 error[E0005]: refutable pattern in local binding: `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
56   --> $DIR/const-match-check.rs:19:26
57    |
58 LL |     const X: i32 = { let 0 = 0; 0 };
59    |                          ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
60    |
61    = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
62    = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
63    = note: the matched value is of type `i32`
64 help: you might want to use `if let` to ignore the variants that aren't matched
65    |
66 LL |     const X: i32 = { if let 0 = 0 { todo!() } 0 };
67    |                      ++           ~~~~~~~~~~~
68 help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
69    |
70 LL |     const X: i32 = { let 0 = 0 else { todo!() }; 0 };
71    |                                ++++++++++++++++
72
73 error: aborting due to 4 previous errors
74
75 For more information about this error, try `rustc --explain E0005`.