about summary refs log tree commit diff
path: root/tests/ui/variance
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-07-26 14:32:19 -0400
committerMichael Goulet <michael@errs.io>2024-07-26 14:41:56 -0400
commit91acacf85b9f81aeb41901f8918128bfe02946c8 (patch)
tree24f38bf31ef9f15930e66da7d4e187a73d7ed932 /tests/ui/variance
parente7eae5370e304fb1534c1964852a6c127f1f09f8 (diff)
downloadrust-91acacf85b9f81aeb41901f8918128bfe02946c8.tar.gz
rust-91acacf85b9f81aeb41901f8918128bfe02946c8.zip
Peel off explicit (or implicit) deref before suggesting clone on move error in borrowck
Diffstat (limited to 'tests/ui/variance')
-rw-r--r--tests/ui/variance/variance-issue-20533.stderr13
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/ui/variance/variance-issue-20533.stderr b/tests/ui/variance/variance-issue-20533.stderr
index 0a810b7222e..21d8de6ae88 100644
--- a/tests/ui/variance/variance-issue-20533.stderr
+++ b/tests/ui/variance/variance-issue-20533.stderr
@@ -17,7 +17,7 @@ LL | struct AffineU32(u32);
    | ^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type
 ...
 LL |         let x = foo(&a);
-   |                     -- you could clone this value
+   |                      - you could clone this value
 
 error[E0505]: cannot move out of `a` because it is borrowed
   --> $DIR/variance-issue-20533.rs:41:14
@@ -38,7 +38,7 @@ LL | struct AffineU32(u32);
    | ^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type
 ...
 LL |         let x = bar(&a);
-   |                     -- you could clone this value
+   |                      - you could clone this value
 
 error[E0505]: cannot move out of `a` because it is borrowed
   --> $DIR/variance-issue-20533.rs:47:14
@@ -59,7 +59,7 @@ LL | struct AffineU32(u32);
    | ^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type
 ...
 LL |         let x = baz(&a);
-   |                     -- you could clone this value
+   |                      - you could clone this value
 
 error[E0505]: cannot move out of `a` because it is borrowed
   --> $DIR/variance-issue-20533.rs:53:14
@@ -80,7 +80,7 @@ LL | struct AffineU32(u32);
    | ^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type
 ...
 LL |         let x = bat(&a);
-   |                     -- you could clone this value
+   |                      - you could clone this value
 
 error[E0505]: cannot move out of `a` because it is borrowed
   --> $DIR/variance-issue-20533.rs:59:14
@@ -96,9 +96,8 @@ LL |         drop(x);
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -         let x = foo(&a);
-LL +         let x = foo(a.clone());
-   |
+LL |         let x = foo(&a.clone());
+   |                       ++++++++
 
 error: aborting due to 5 previous errors