summaryrefslogtreecommitdiffstats
path: root/src/test/ui/moves/moves-based-on-type-exprs.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:32 +0000
commit4547b622d8d29df964fa2914213088b148c498fc (patch)
tree9fc6b25f3c3add6b745be9a2400a6e96140046e9 /src/test/ui/moves/moves-based-on-type-exprs.stderr
parentReleasing progress-linux version 1.66.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-4547b622d8d29df964fa2914213088b148c498fc.tar.xz
rustc-4547b622d8d29df964fa2914213088b148c498fc.zip
Merging upstream version 1.67.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/moves/moves-based-on-type-exprs.stderr')
-rw-r--r--src/test/ui/moves/moves-based-on-type-exprs.stderr60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/test/ui/moves/moves-based-on-type-exprs.stderr b/src/test/ui/moves/moves-based-on-type-exprs.stderr
index 9bcec3674..838b1282c 100644
--- a/src/test/ui/moves/moves-based-on-type-exprs.stderr
+++ b/src/test/ui/moves/moves-based-on-type-exprs.stderr
@@ -7,6 +7,11 @@ LL | let _y = Foo { f:x };
| - value moved here
LL | touch(&x);
| ^^ value borrowed here after move
+ |
+help: consider cloning the value if the performance cost is acceptable
+ |
+LL | let _y = Foo { f:x.clone() };
+ | ++++++++
error[E0382]: borrow of moved value: `x`
--> $DIR/moves-based-on-type-exprs.rs:18:11
@@ -17,6 +22,11 @@ LL | let _y = (x, 3);
| - value moved here
LL | touch(&x);
| ^^ value borrowed here after move
+ |
+help: consider cloning the value if the performance cost is acceptable
+ |
+LL | let _y = (x.clone(), 3);
+ | ++++++++
error[E0382]: borrow of moved value: `x`
--> $DIR/moves-based-on-type-exprs.rs:35:11
@@ -29,6 +39,11 @@ LL | x
...
LL | touch(&x);
| ^^ value borrowed here after move
+ |
+help: consider cloning the value if the performance cost is acceptable
+ |
+LL | x.clone()
+ | ++++++++
error[E0382]: borrow of moved value: `y`
--> $DIR/moves-based-on-type-exprs.rs:36:11
@@ -41,6 +56,11 @@ LL | y
...
LL | touch(&y);
| ^^ value borrowed here after move
+ |
+help: consider cloning the value if the performance cost is acceptable
+ |
+LL | y.clone()
+ | ++++++++
error[E0382]: borrow of moved value: `x`
--> $DIR/moves-based-on-type-exprs.rs:46:11
@@ -53,6 +73,11 @@ LL | true => x,
...
LL | touch(&x);
| ^^ value borrowed here after move
+ |
+help: consider cloning the value if the performance cost is acceptable
+ |
+LL | true => x.clone(),
+ | ++++++++
error[E0382]: borrow of moved value: `y`
--> $DIR/moves-based-on-type-exprs.rs:47:11
@@ -65,6 +90,11 @@ LL | false => y
...
LL | touch(&y);
| ^^ value borrowed here after move
+ |
+help: consider cloning the value if the performance cost is acceptable
+ |
+LL | false => y.clone()
+ | ++++++++
error[E0382]: borrow of moved value: `x`
--> $DIR/moves-based-on-type-exprs.rs:58:11
@@ -77,6 +107,18 @@ LL | _ if guard(x) => 10,
...
LL | touch(&x);
| ^^ value borrowed here after move
+ |
+note: consider changing this parameter type in function `guard` to borrow instead if owning the value isn't necessary
+ --> $DIR/moves-based-on-type-exprs.rs:6:14
+ |
+LL | fn guard(_s: String) -> bool {panic!()}
+ | ----- ^^^^^^ this parameter takes ownership of the value
+ | |
+ | in this function
+help: consider cloning the value if the performance cost is acceptable
+ |
+LL | _ if guard(x.clone()) => 10,
+ | ++++++++
error[E0382]: borrow of moved value: `x`
--> $DIR/moves-based-on-type-exprs.rs:65:11
@@ -87,6 +129,11 @@ LL | let _y = [x];
| - value moved here
LL | touch(&x);
| ^^ value borrowed here after move
+ |
+help: consider cloning the value if the performance cost is acceptable
+ |
+LL | let _y = [x.clone()];
+ | ++++++++
error[E0382]: borrow of moved value: `x`
--> $DIR/moves-based-on-type-exprs.rs:71:11
@@ -97,6 +144,11 @@ LL | let _y = vec![x];
| - value moved here
LL | touch(&x);
| ^^ value borrowed here after move
+ |
+help: consider cloning the value if the performance cost is acceptable
+ |
+LL | let _y = vec![x.clone()];
+ | ++++++++
error[E0382]: borrow of moved value: `x`
--> $DIR/moves-based-on-type-exprs.rs:77:11
@@ -113,6 +165,10 @@ note: this function takes ownership of the receiver `self`, which moves `x`
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^
+help: consider cloning the value if the performance cost is acceptable
+ |
+LL | let _y = x.clone().into_iter().next().unwrap();
+ | ++++++++
error[E0382]: borrow of moved value: `x`
--> $DIR/moves-based-on-type-exprs.rs:83:11
@@ -129,6 +185,10 @@ note: this function takes ownership of the receiver `self`, which moves `x`
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^
+help: consider cloning the value if the performance cost is acceptable
+ |
+LL | let _y = [x.clone().into_iter().next().unwrap(); 1];
+ | ++++++++
error: aborting due to 11 previous errors