fork/rust

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

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

master
927 B26 linesraw
1error[E0382]: use of moved value: `x`
2  --> $DIR/liveness-move-call-arg.rs:9:14
3   |
4LL |     let x: Box<isize> = Box::new(25);
5   |         - move occurs because `x` has type `Box<isize>`, which does not implement the `Copy` trait
6LL |
7LL |     loop {
8   |     ---- inside of this loop
9LL |         take(x);
10   |              ^ value moved here, in previous iteration of loop
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   |               ++++++++
23
24error: aborting due to previous error
25
26For more information about this error, try `rustc --explain E0382`.