]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-move-error-with-note.stderr
Rollup merge of #106648 - Nilstrieb:poly-cleanup, r=compiler-errors
[rust.git] / tests / ui / borrowck / borrowck-move-error-with-note.stderr
1 error[E0507]: cannot move out of `f` as enum variant `Foo1` which is behind a shared reference
2   --> $DIR/borrowck-move-error-with-note.rs:13:11
3    |
4 LL |     match *f {
5    |           ^^
6 LL |         Foo::Foo1(num1,
7    |                   ---- data moved here
8 LL |                   num2) => (),
9    |                   ---- ...and here
10 LL |         Foo::Foo2(num) => (),
11    |                   --- ...and here
12    |
13    = note: move occurs because these variables have types that don't implement the `Copy` trait
14 help: consider removing the dereference here
15    |
16 LL -     match *f {
17 LL +     match f {
18    |
19
20 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
21   --> $DIR/borrowck-move-error-with-note.rs:30:11
22    |
23 LL |     match (S {f: "foo".to_string(), g: "bar".to_string()}) {
24    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
25 ...
26 LL |             f: _s,
27    |                -- data moved here
28 LL |             g: _t
29    |                -- ...and here
30    |
31    = note: move occurs because these variables have types that don't implement the `Copy` trait
32 help: consider borrowing the pattern binding
33    |
34 LL |             f: ref _s,
35    |                +++
36 help: consider borrowing the pattern binding
37    |
38 LL |             g: ref _t
39    |                +++
40
41 error[E0507]: cannot move out of `a.a` which is behind a shared reference
42   --> $DIR/borrowck-move-error-with-note.rs:48:11
43    |
44 LL |     match a.a {
45    |           ^^^
46 LL |         n => {
47    |         -
48    |         |
49    |         data moved here
50    |         move occurs because `n` has type `Box<isize>`, which does not implement the `Copy` trait
51    |
52 help: consider borrowing here
53    |
54 LL |     match &a.a {
55    |           +
56
57 error: aborting due to 3 previous errors
58
59 Some errors have detailed explanations: E0507, E0509.
60 For more information about an error, try `rustc --explain E0507`.