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