]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/match-cfg-fake-edges.stderr
Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino
[rust.git] / src / test / ui / nll / match-cfg-fake-edges.stderr
1 error[E0381]: used binding `x` isn't initialized
2   --> $DIR/match-cfg-fake-edges.rs:21:13
3    |
4 LL |     let x;
5    |         - binding declared here but left uninitialized
6 ...
7 LL |         _ if { x = 2; true } => 1,
8    |                ----- binding initialized here in some conditions
9 LL |         _ if {
10 LL |             x;
11    |             ^ `x` used here but it isn't initialized
12    |
13 help: consider assigning a value
14    |
15 LL |     let x = 0;
16    |           +++
17
18 error[E0382]: use of moved value: `x`
19   --> $DIR/match-cfg-fake-edges.rs:35:13
20    |
21 LL |     let x = String::new();
22    |         - move occurs because `x` has type `String`, which does not implement the `Copy` trait
23 ...
24 LL |         false if { drop(x); true } => 1,
25    |                         - value moved here
26 LL |         true => {
27 LL |             x;
28    |             ^ value used here after move
29    |
30 help: consider cloning the value if the performance cost is acceptable
31    |
32 LL |         false if { drop(x.clone()); true } => 1,
33    |                          ++++++++
34
35 error: aborting due to 2 previous errors
36
37 Some errors have detailed explanations: E0381, E0382.
38 For more information about an error, try `rustc --explain E0381`.