summaryrefslogtreecommitdiffstats
path: root/tests/ui/moves/moves-based-on-type-tuple.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/moves/moves-based-on-type-tuple.stderr')
-rw-r--r--tests/ui/moves/moves-based-on-type-tuple.stderr19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/moves/moves-based-on-type-tuple.stderr b/tests/ui/moves/moves-based-on-type-tuple.stderr
new file mode 100644
index 000000000..0bcce3012
--- /dev/null
+++ b/tests/ui/moves/moves-based-on-type-tuple.stderr
@@ -0,0 +1,19 @@
+error[E0382]: use of moved value: `x`
+ --> $DIR/moves-based-on-type-tuple.rs:4:18
+ |
+LL | fn dup(x: Box<isize>) -> Box<(Box<isize>,Box<isize>)> {
+ | - move occurs because `x` has type `Box<isize>`, which does not implement the `Copy` trait
+...
+LL | Box::new((x, x))
+ | - ^ value used here after move
+ | |
+ | value moved here
+ |
+help: consider cloning the value if the performance cost is acceptable
+ |
+LL | Box::new((x.clone(), x))
+ | ++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0382`.