fork/rust

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

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

master
3.6 KiB75 linesraw
1error[E0005]: refutable pattern in local binding
2  --> $DIR/const-match-check.rs:4:22
3   |
4LL | 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`
10help: you might want to use `if let` to ignore the variants that aren't matched
11   |
12LL | const X: i32 = { if let 0 = 0 { todo!() }; 0 };
13   |                  ++           +++++++++++
14help: alternatively, you could prepend the pattern with an underscore to define a new named variable; identifiers cannot begin with digits
15   |
16LL | const X: i32 = { let _0 = 0; 0 };
17   |                      +
18
19error[E0005]: refutable pattern in local binding
20  --> $DIR/const-match-check.rs:8:23
21   |
22LL | 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`
28help: you might want to use `if let` to ignore the variants that aren't matched
29   |
30LL | static Y: i32 = { if let 0 = 0 { todo!() }; 0 };
31   |                   ++           +++++++++++
32help: alternatively, you could prepend the pattern with an underscore to define a new named variable; identifiers cannot begin with digits
33   |
34LL | static Y: i32 = { let _0 = 0; 0 };
35   |                       +
36
37error[E0005]: refutable pattern in local binding
38  --> $DIR/const-match-check.rs:13:26
39   |
40LL |     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`
46help: you might want to use `if let` to ignore the variants that aren't matched
47   |
48LL |     const X: i32 = { if let 0 = 0 { todo!() }; 0 };
49   |                      ++           +++++++++++
50help: alternatively, you could prepend the pattern with an underscore to define a new named variable; identifiers cannot begin with digits
51   |
52LL |     const X: i32 = { let _0 = 0; 0 };
53   |                          +
54
55error[E0005]: refutable pattern in local binding
56  --> $DIR/const-match-check.rs:19:26
57   |
58LL |     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`
64help: you might want to use `if let` to ignore the variants that aren't matched
65   |
66LL |     const X: i32 = { if let 0 = 0 { todo!() }; 0 };
67   |                      ++           +++++++++++
68help: alternatively, you could prepend the pattern with an underscore to define a new named variable; identifiers cannot begin with digits
69   |
70LL |     const X: i32 = { let _0 = 0; 0 };
71   |                          +
72
73error: aborting due to 4 previous errors
74
75For more information about this error, try `rustc --explain E0005`.