]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | error[E0382]: use of moved value: `x` |
0731742a | 2 | --> $DIR/liveness-move-call-arg.rs:9:14 |
b7449926 | 3 | | |
c295e0f8 | 4 | LL | let x: Box<isize> = Box::new(25); |
1b1a35ee | 5 | | - move occurs because `x` has type `Box<isize>`, which does not implement the `Copy` trait |
487cf647 FG |
6 | LL | |
7 | LL | loop { | |
8 | | ---- inside of this loop | |
532ac7d7 | 9 | LL | take(x); |
48663c56 | 10 | | ^ value moved here, in previous iteration of loop |
487cf647 FG |
11 | | |
12 | note: consider changing this parameter type in function `take` to borrow instead if owning the value isn't necessary | |
13 | --> $DIR/liveness-move-call-arg.rs:1:13 | |
14 | | | |
15 | LL | fn take(_x: Box<isize>) {} | |
16 | | ---- ^^^^^^^^^^ this parameter takes ownership of the value | |
17 | | | | |
18 | | in this function | |
19 | help: consider cloning the value if the performance cost is acceptable | |
20 | | | |
21 | LL | take(x.clone()); | |
22 | | ++++++++ | |
b7449926 XL |
23 | |
24 | error: aborting due to previous error | |
25 | ||
26 | For more information about this error, try `rustc --explain E0382`. |