]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/liveness/liveness-move-in-loop.stderr
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / liveness / liveness-move-in-loop.stderr
index 832d4f8fa030f9fae223c2db1c27565e8e40d861..a060914f17859539736a35de38fd893a9074b419 100644 (file)
@@ -4,8 +4,22 @@ error[E0382]: use of moved value: `y`
 LL |     let y: Box<isize> = 42.into();
    |         - move occurs because `y` has type `Box<isize>`, which does not implement the `Copy` trait
 ...
+LL |     loop {
+   |     ---- inside of this loop
+LL |         println!("{}", y);
+LL |         loop {
+   |         ---- inside of this loop
+LL |             loop {
+   |             ---- inside of this loop
+LL |                 loop {
+   |                 ---- inside of this loop
 LL |                     x = y;
    |                         ^ value moved here, in previous iteration of loop
+   |
+help: consider cloning the value if the performance cost is acceptable
+   |
+LL |                     x = y.clone();
+   |                          ++++++++
 
 error: aborting due to previous error