]> git.proxmox.com Git - rustc.git/blame - src/test/ui/liveness/liveness-move-call-arg.stderr
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / liveness / liveness-move-call-arg.stderr
CommitLineData
b7449926 1error[E0382]: use of moved value: `x`
0731742a 2 --> $DIR/liveness-move-call-arg.rs:9:14
b7449926 3 |
c295e0f8 4LL | 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
6LL |
7LL | loop {
8 | ---- inside of this loop
532ac7d7 9LL | take(x);
48663c56 10 | ^ value moved here, in previous iteration of loop
487cf647
FG
11 |
12note: 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 |
15LL | fn take(_x: Box<isize>) {}
16 | ---- ^^^^^^^^^^ this parameter takes ownership of the value
17 | |
18 | in this function
19help: consider cloning the value if the performance cost is acceptable
20 |
21LL | take(x.clone());
22 | ++++++++
b7449926
XL
23
24error: aborting due to previous error
25
26For more information about this error, try `rustc --explain E0382`.