]> git.lizzy.rs Git - rust.git/blob - tests/ui/liveness/liveness-move-in-while.stderr
Rollup merge of #107740 - oli-obk:lock_tcx, r=petrochenkov
[rust.git] / tests / ui / liveness / liveness-move-in-while.stderr
1 warning: denote infinite loops with `loop { ... }`
2   --> $DIR/liveness-move-in-while.rs:8:9
3    |
4 LL |         while true { while true { while true { x = y; x.clone(); } } }
5    |         ^^^^^^^^^^ help: use `loop`
6    |
7    = note: `#[warn(while_true)]` on by default
8
9 warning: denote infinite loops with `loop { ... }`
10   --> $DIR/liveness-move-in-while.rs:8:22
11    |
12 LL |         while true { while true { while true { x = y; x.clone(); } } }
13    |                      ^^^^^^^^^^ help: use `loop`
14
15 warning: denote infinite loops with `loop { ... }`
16   --> $DIR/liveness-move-in-while.rs:8:35
17    |
18 LL |         while true { while true { while true { x = y; x.clone(); } } }
19    |                                   ^^^^^^^^^^ help: use `loop`
20
21 error[E0382]: borrow of moved value: `y`
22   --> $DIR/liveness-move-in-while.rs:7:24
23    |
24 LL |     let y: Box<isize> = 42.into();
25    |         - move occurs because `y` has type `Box<isize>`, which does not implement the `Copy` trait
26 ...
27 LL |     loop {
28    |     ---- inside of this loop
29 LL |         println!("{}", y);
30    |                        ^ value borrowed here after move
31 LL |         while true { while true { while true { x = y; x.clone(); } } }
32    |         ----------   ----------   ----------       - value moved here, in previous iteration of loop
33    |         |            |            |
34    |         |            |            inside of this loop
35    |         |            inside of this loop
36    |         inside of this loop
37    |
38    = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
39 help: consider cloning the value if the performance cost is acceptable
40    |
41 LL |         while true { while true { while true { x = y.clone(); x.clone(); } } }
42    |                                                     ++++++++
43
44 error: aborting due to previous error; 3 warnings emitted
45
46 For more information about this error, try `rustc --explain E0382`.