]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/move-in-pattern-mut.stderr
Provide suggestions for some moved value errors
[rust.git] / src / test / ui / borrowck / move-in-pattern-mut.stderr
1 error[E0382]: use of moved value: `s`
2   --> $DIR/move-in-pattern-mut.rs:18:9
3    |
4 LL |     if let Some(mut x) = s {
5    |                 ----- value moved here
6 ...
7 LL |     foo(s);
8    |         ^ value used here after partial move
9    |
10    = note: move occurs because value has type `S`, which does not implement the `Copy` trait
11 help: borrow this field in the pattern to avoid moving `s.0`
12    |
13 LL |     if let Some(ref mut x) = s {
14    |                 ^^^
15
16 error[E0382]: use of moved value: `e`
17   --> $DIR/move-in-pattern-mut.rs:22:9
18    |
19 LL |     let E::V { s: mut x } = e;
20    |                   ----- value moved here
21 LL |     x = S;
22 LL |     bar(e);
23    |         ^ value used here after partial move
24    |
25    = note: move occurs because value has type `S`, which does not implement the `Copy` trait
26 help: borrow this field in the pattern to avoid moving `e.s`
27    |
28 LL |     let E::V { s: ref mut x } = e;
29    |                   ^^^
30
31 error: aborting due to 2 previous errors
32
33 For more information about this error, try `rustc --explain E0382`.