]> git.lizzy.rs Git - rust.git/blob - tests/ui/liveness/liveness-move-in-loop.stderr
Rollup merge of #107740 - oli-obk:lock_tcx, r=petrochenkov
[rust.git] / tests / ui / liveness / liveness-move-in-loop.stderr
1 error[E0382]: use of moved value: `y`
2   --> $DIR/liveness-move-in-loop.rs:11:25
3    |
4 LL |     let y: Box<isize> = 42.into();
5    |         - move occurs because `y` has type `Box<isize>`, which does not implement the `Copy` trait
6 ...
7 LL |     loop {
8    |     ---- inside of this loop
9 LL |         println!("{}", y);
10 LL |         loop {
11    |         ---- inside of this loop
12 LL |             loop {
13    |             ---- inside of this loop
14 LL |                 loop {
15    |                 ---- inside of this loop
16 LL |                     x = y;
17    |                         ^ value moved here, in previous iteration of loop
18    |
19 help: consider cloning the value if the performance cost is acceptable
20    |
21 LL |                     x = y.clone();
22    |                          ++++++++
23
24 error: aborting due to previous error
25
26 For more information about this error, try `rustc --explain E0382`.