]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/try-block/try-block-maybe-bad-lifetime.stderr
Update unsuspicious file list
[rustc.git] / src / test / ui / try-block / try-block-maybe-bad-lifetime.stderr
index 1f0e09277ba97dc90a21ac215e8729a89a6e8272..f738b03eed6b8441cba5d88252b8dd6ddb39a1cb 100644 (file)
@@ -14,13 +14,19 @@ error[E0382]: borrow of moved value: `x`
   --> $DIR/try-block-maybe-bad-lifetime.rs:28:24
    |
 LL |         let x = String::new();
-   |             - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait
+   |             - move occurs because `x` has type `String`, which does not implement the `Copy` trait
 ...
 LL |             ::std::mem::drop(x);
    |                              - value moved here
 LL |         };
 LL |         println!("{}", x);
    |                        ^ value borrowed here after move
+   |
+   = 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)
+help: consider cloning the value if the performance cost is acceptable
+   |
+LL |             ::std::mem::drop(x.clone());
+   |                               ++++++++
 
 error[E0506]: cannot assign to `i` because it is borrowed
   --> $DIR/try-block-maybe-bad-lifetime.rs:40:9