rust/src/test/ui/liveness/liveness-move-in-while.stderr

22 lines
973 B
Plaintext
Raw Normal View History

2018-08-08 07:28:26 -05:00
error[E0382]: use of moved value: `y`
--> $DIR/liveness-move-in-while.rs:17:24
|
LL | println!("{}", y); //~ ERROR use of moved value: `y`
| ^ value used here after move
LL | while true { while true { while true { x = y; x.clone(); } } }
| - value moved here
|
= note: move occurs because `y` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
error[E0382]: use of moved value: `y`
--> $DIR/liveness-move-in-while.rs:18:52
|
LL | while true { while true { while true { x = y; x.clone(); } } }
| ^ value moved here in previous iteration of loop
|
= note: move occurs because `y` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0382`.