]> git.lizzy.rs Git - rust.git/blob - tests/ui/moves/pin-mut-reborrow.stderr
Auto merge of #106520 - ehuss:update-mdbook, r=Mark-Simulacrum
[rust.git] / tests / ui / moves / pin-mut-reborrow.stderr
1 error[E0382]: use of moved value: `foo`
2   --> $DIR/pin-mut-reborrow.rs:14:5
3    |
4 LL |     let mut foo = Pin::new(&mut foo);
5    |         ------- move occurs because `foo` has type `Pin<&mut Foo>`, which does not implement the `Copy` trait
6 LL |     foo.foo();
7    |         ----- `foo` moved due to this method call
8 LL |     foo.foo();
9    |     ^^^ value used here after move
10    |
11 note: `Foo::foo` takes ownership of the receiver `self`, which moves `foo`
12   --> $DIR/pin-mut-reborrow.rs:7:12
13    |
14 LL |     fn foo(self: Pin<&mut Self>) {}
15    |            ^^^^
16 help: consider reborrowing the `Pin` instead of moving it
17    |
18 LL |     foo.as_mut().foo();
19    |         +++++++++
20
21 error: aborting due to previous error
22
23 For more information about this error, try `rustc --explain E0382`.