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