]> git.lizzy.rs Git - rust.git/blob - tests/ui/moves/pin-mut-reborrow-infer-var-issue-107419.stderr
Auto merge of #107443 - cjgillot:generator-less-query, r=compiler-errors
[rust.git] / tests / ui / moves / pin-mut-reborrow-infer-var-issue-107419.stderr
1 error[E0382]: use of moved value: `r`
2   --> $DIR/pin-mut-reborrow-infer-var-issue-107419.rs:10:9
3    |
4 LL |     let mut r = Pin::new(&mut uwu);
5    |         ----- move occurs because `r` has type `Pin<&mut ()>`, which does not implement the `Copy` trait
6 LL |     foo(r.get_mut());
7    |           --------- `r` moved due to this method call
8 LL |     foo(r.get_mut());
9    |         ^ value used here after move
10    |
11 note: `Pin::<&'a mut T>::get_mut` takes ownership of the receiver `self`, which moves `r`
12   --> $SRC_DIR/core/src/pin.rs:LL:COL
13 help: consider reborrowing the `Pin` instead of moving it
14    |
15 LL |     foo(r.as_mut().get_mut());
16    |           +++++++++
17
18 error: aborting due to previous error
19
20 For more information about this error, try `rustc --explain E0382`.