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