fork/rust

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

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

master
2.3 KiB72 linesraw
1error[E0381]: used binding `x` isn't initialized
2  --> $DIR/match-cfg-fake-edges.rs:29:13
3   |
4LL |     let x;
5   |         - binding declared here but left uninitialized
6...
7LL |         _ if { x = 2; true } => 1,
8   |                ----- binding initialized here in some conditions
9LL |         _ if {
10LL |             x;
11   |             ^ `x` used here but it isn't initialized
12   |
13help: consider assigning a value
14   |
15LL |     let x = 0;
16   |           +++
17
18error[E0381]: used binding `x` isn't initialized
19  --> $DIR/match-cfg-fake-edges.rs:39:13
20   |
21LL |     let x;
22   |         - binding declared here but left uninitialized
23LL |     match y {
24LL |         _ if let Some(()) = { x = 2; Some(()) } => 1,
25   |                               ----- binding initialized here in some conditions
26LL |         _ if let Some(()) = {
27LL |             x;
28   |             ^ `x` used here but it isn't initialized
29   |
30help: consider assigning a value
31   |
32LL |     let x = 0;
33   |           +++
34
35error[E0382]: use of moved value: `x`
36  --> $DIR/match-cfg-fake-edges.rs:53:13
37   |
38LL |     let x = String::new();
39   |         - move occurs because `x` has type `String`, which does not implement the `Copy` trait
40...
41LL |         false if { drop(x); true } => 1,
42   |                         - value moved here
43LL |         true => {
44LL |             x;
45   |             ^ value used here after move
46   |
47help: consider cloning the value if the performance cost is acceptable
48   |
49LL |         false if { drop(x.clone()); true } => 1,
50   |                          ++++++++
51
52error[E0382]: use of moved value: `x`
53  --> $DIR/match-cfg-fake-edges.rs:63:13
54   |
55LL |     let x = String::new();
56   |         - move occurs because `x` has type `String`, which does not implement the `Copy` trait
57LL |     match y {
58LL |         false if let Some(()) = { drop(x); Some(()) } => 1,
59   |                                        - value moved here
60LL |         true => {
61LL |             x;
62   |             ^ value used here after move
63   |
64help: consider cloning the value if the performance cost is acceptable
65   |
66LL |         false if let Some(()) = { drop(x.clone()); Some(()) } => 1,
67   |                                         ++++++++
68
69error: aborting due to 4 previous errors
70
71Some errors have detailed explanations: E0381, E0382.
72For more information about an error, try `rustc --explain E0381`.