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

35 lines
1.3 KiB
Text
Raw Normal View History

warning: denote infinite loops with `loop { ... }`
--> $DIR/liveness-move-in-while.rs:8:9
|
LL | while true { while true { while true { x = y; x.clone(); } } }
| ^^^^^^^^^^ help: use `loop`
|
= note: `#[warn(while_true)]` on by default
warning: denote infinite loops with `loop { ... }`
--> $DIR/liveness-move-in-while.rs:8:22
|
LL | while true { while true { while true { x = y; x.clone(); } } }
| ^^^^^^^^^^ help: use `loop`
warning: denote infinite loops with `loop { ... }`
--> $DIR/liveness-move-in-while.rs:8:35
|
LL | while true { while true { while true { x = y; x.clone(); } } }
| ^^^^^^^^^^ help: use `loop`
error[E0382]: borrow of moved value: `y`
2018-12-25 08:56:47 -07:00
--> $DIR/liveness-move-in-while.rs:7:24
2018-08-08 14:28:26 +02:00
|
LL | let y: Box<isize> = box 42;
| - move occurs because `y` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
...
2019-03-09 15:03:44 +03:00
LL | println!("{}", y);
| ^ value borrowed here after move
2018-08-08 14:28:26 +02:00
LL | while true { while true { while true { x = y; x.clone(); } } }
| - value moved here, in previous iteration of loop
2018-08-08 14:28:26 +02:00
error: aborting due to previous error
2018-08-08 14:28:26 +02:00
For more information about this error, try `rustc --explain E0382`.