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