about summary refs log tree commit diff
path: root/tests/ui/reborrow/pin_mut.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/reborrow/pin_mut.stderr')
-rw-r--r--tests/ui/reborrow/pin_mut.stderr21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/reborrow/pin_mut.stderr b/tests/ui/reborrow/pin_mut.stderr
new file mode 100644
index 00000000000..64e3f603e11
--- /dev/null
+++ b/tests/ui/reborrow/pin_mut.stderr
@@ -0,0 +1,21 @@
+error[E0382]: use of moved value: `a`
+  --> $DIR/pin_mut.rs:9:20
+   |
+LL |     let a = Pin::new(a);
+   |         - move occurs because `a` has type `Pin<&mut ()>`, which does not implement the `Copy` trait
+LL |     let _ = method(a);
+   |                    - value moved here
+LL |     let _ = method(a);
+   |                    ^ value used here after move
+   |
+note: consider changing this parameter type in function `method` to borrow instead if owning the value isn't necessary
+  --> $DIR/pin_mut.rs:3:14
+   |
+LL | fn method(a: Pin<&mut ()>) {}
+   |    ------    ^^^^^^^^^^^^ this parameter takes ownership of the value
+   |    |
+   |    in this function
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0382`.