about summary refs log tree commit diff
path: root/tests/ui/variance
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-03-13 02:13:51 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-04-11 16:41:41 +0000
commitbce78102c31c2e71313af1e8119eb882dea35fad (patch)
treee2d98472608a475803d22252b0489cd629cebf78 /tests/ui/variance
parentfa2fc3ab9638aec571574e551cd9708aa4b64280 (diff)
downloadrust-bce78102c31c2e71313af1e8119eb882dea35fad.tar.gz
rust-bce78102c31c2e71313af1e8119eb882dea35fad.zip
Account for unops when suggesting cloning
Diffstat (limited to 'tests/ui/variance')
-rw-r--r--tests/ui/variance/variance-issue-20533.stderr15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/ui/variance/variance-issue-20533.stderr b/tests/ui/variance/variance-issue-20533.stderr
index 7fed947972f..bee9b802135 100644
--- a/tests/ui/variance/variance-issue-20533.stderr
+++ b/tests/ui/variance/variance-issue-20533.stderr
@@ -12,8 +12,9 @@ LL |         drop(x);
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL |         let x = foo(&a.clone());
-   |                       ++++++++
+LL -         let x = foo(&a);
+LL +         let x = foo(a.clone());
+   |
 
 error[E0505]: cannot move out of `a` because it is borrowed
   --> $DIR/variance-issue-20533.rs:34:14
@@ -29,8 +30,9 @@ LL |         drop(x);
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL |         let x = bar(&a.clone());
-   |                       ++++++++
+LL -         let x = bar(&a);
+LL +         let x = bar(a.clone());
+   |
 
 error[E0505]: cannot move out of `a` because it is borrowed
   --> $DIR/variance-issue-20533.rs:40:14
@@ -46,8 +48,9 @@ LL |         drop(x);
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL |         let x = baz(&a.clone());
-   |                       ++++++++
+LL -         let x = baz(&a);
+LL +         let x = baz(a.clone());
+   |
 
 error: aborting due to 3 previous errors