about summary refs log tree commit diff
path: root/tests/ui/issues/issue-2590.stderr
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-03-13 03:41:41 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-04-11 16:41:41 +0000
commit10c2fbec2437a873463382726d4815520430ff1f (patch)
treed067beb0dbc809ca4fe64ad84be899c97b082d4c /tests/ui/issues/issue-2590.stderr
parentbce78102c31c2e71313af1e8119eb882dea35fad (diff)
downloadrust-10c2fbec2437a873463382726d4815520430ff1f.tar.gz
rust-10c2fbec2437a873463382726d4815520430ff1f.zip
Suggest `.clone()` in some move errors
```
error[E0507]: cannot move out of `*x` which is behind a shared reference
  --> $DIR/borrowck-fn-in-const-a.rs:6:16
   |
LL |         return *x
   |                ^^ move occurs because `*x` has type `String`, which does not implement the `Copy` trait
   |
help: consider cloning the value if the performance cost is acceptable
   |
LL -         return *x
LL +         return x.clone()
   |
```
Diffstat (limited to 'tests/ui/issues/issue-2590.stderr')
-rw-r--r--tests/ui/issues/issue-2590.stderr5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-2590.stderr b/tests/ui/issues/issue-2590.stderr
index 517b4814eae..822856652e9 100644
--- a/tests/ui/issues/issue-2590.stderr
+++ b/tests/ui/issues/issue-2590.stderr
@@ -3,6 +3,11 @@ error[E0507]: cannot move out of `self.tokens` which is behind a shared referenc
    |
 LL |         self.tokens
    |         ^^^^^^^^^^^ move occurs because `self.tokens` has type `Vec<isize>`, which does not implement the `Copy` trait
+   |
+help: consider cloning the value if the performance cost is acceptable
+   |
+LL |         self.tokens.clone()
+   |                    ++++++++
 
 error: aborting due to 1 previous error