about summary refs log tree commit diff
path: root/src/test/ui/error-codes
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-03-09 08:58:47 +0000
committerbors <bors@rust-lang.org>2022-03-09 08:58:47 +0000
commit10dccdc7fcbdc64ee9efe2c1ed975ab8c1d61287 (patch)
treeac3a8cd3110ee50a3b957ef43085a344c92a7027 /src/test/ui/error-codes
parent6045c34f15d463c7d51104b968c1eabc5275b9c1 (diff)
parent98752776b853cad6fc99f51d91f7fdd797490a8d (diff)
downloadrust-10dccdc7fcbdc64ee9efe2c1ed975ab8c1d61287.tar.gz
rust-10dccdc7fcbdc64ee9efe2c1ed975ab8c1d61287.zip
Auto merge of #94515 - estebank:tweak-move-error, r=davidtwco
Tweak move error

Point at method definition that causes type to be consumed.

Fix #94056.
Diffstat (limited to 'src/test/ui/error-codes')
-rw-r--r--src/test/ui/error-codes/E0507.stderr11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/test/ui/error-codes/E0507.stderr b/src/test/ui/error-codes/E0507.stderr
index 3837e206169..ce8d1ef0349 100644
--- a/src/test/ui/error-codes/E0507.stderr
+++ b/src/test/ui/error-codes/E0507.stderr
@@ -2,7 +2,16 @@ error[E0507]: cannot move out of dereference of `Ref<'_, TheDarkKnight>`
   --> $DIR/E0507.rs:12:5
    |
 LL |     x.borrow().nothing_is_true();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because value has type `TheDarkKnight`, which does not implement the `Copy` trait
+   |     ^^^^^^^^^^^-----------------
+   |     |          |
+   |     |          value moved due to this method call
+   |     move occurs because value has type `TheDarkKnight`, which does not implement the `Copy` trait
+   |
+note: this function takes ownership of the receiver `self`, which moves value
+  --> $DIR/E0507.rs:6:24
+   |
+LL |     fn nothing_is_true(self) {}
+   |                        ^^^^
 
 error: aborting due to previous error