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

22 lines
971 B
Plaintext
Raw Normal View History

2018-08-08 07:28:26 -05:00
error[E0382]: use of moved value: `y`
2018-12-25 09:56:47 -06:00
--> $DIR/liveness-move-in-while.rs:7:24
2018-08-08 07:28:26 -05:00
|
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`
2018-12-25 09:56:47 -06:00
--> $DIR/liveness-move-in-while.rs:8:52
2018-08-08 07:28:26 -05:00
|
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`.