]> git.lizzy.rs Git - rust.git/blob - tests/ui/moves/suggest-clone.stderr
Rollup merge of #106244 - atouchet:readme3, r=workingjubilee
[rust.git] / tests / ui / moves / suggest-clone.stderr
1 error[E0507]: cannot move out of `*foo` which is behind a shared reference
2   --> $DIR/suggest-clone.rs:10:5
3    |
4 LL |     foo.foo();
5    |     ^^^^-----
6    |     |   |
7    |     |   `*foo` moved due to this method call
8    |     move occurs because `*foo` has type `Foo`, which does not implement the `Copy` trait
9    |
10 note: `Foo::foo` takes ownership of the receiver `self`, which moves `*foo`
11   --> $DIR/suggest-clone.rs:6:12
12    |
13 LL |     fn foo(self) {}
14    |            ^^^^
15 help: you can `clone` the value and consume it, but this might not be your desired behavior
16    |
17 LL |     foo.clone().foo();
18    |         ++++++++
19
20 error: aborting due to previous error
21
22 For more information about this error, try `rustc --explain E0507`.