]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-move-error-with-note.nll.stderr
Update output for borrowck=migrate compare mode.
[rust.git] / src / test / ui / borrowck / borrowck-move-error-with-note.nll.stderr
1 error[E0507]: cannot move out of borrowed content
2   --> $DIR/borrowck-move-error-with-note.rs:21:11
3    |
4 LL |     match *f {             //~ ERROR cannot move out of
5    |           ^^
6    |           |
7    |           cannot move out of borrowed content
8    |           help: consider removing the `*`: `f`
9 LL |                            //~| cannot move out
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:23:19
19    |
20 LL |         Foo::Foo1(num1,
21    |                   ^^^^
22 LL |                   num2) => (),
23    |                   ^^^^
24 LL |         Foo::Foo2(num) => (),
25    |                   ^^^
26
27 error[E0507]: cannot move out of `f.0` which is behind a `&` reference
28   --> $DIR/borrowck-move-error-with-note.rs:23:19
29    |
30 LL |     let f = &Foo::Foo1(box 1, box 2);
31    |             ------------------------ help: consider changing this to be a mutable reference: `&mut Foo::Foo1(box 1, box 2)`
32 ...
33 LL |         Foo::Foo1(num1,
34    |                   ^^^^
35    |                   |
36    |                   cannot move out of `f.0` which is behind a `&` reference
37    |                   `f` is a `&` reference, so the data it refers to cannot be moved
38
39 error[E0507]: cannot move out of `f.1` which is behind a `&` reference
40   --> $DIR/borrowck-move-error-with-note.rs:24:19
41    |
42 LL |     let f = &Foo::Foo1(box 1, box 2);
43    |             ------------------------ help: consider changing this to be a mutable reference: `&mut Foo::Foo1(box 1, box 2)`
44 ...
45 LL |                   num2) => (),
46    |                   ^^^^
47    |                   |
48    |                   cannot move out of `f.1` which is behind a `&` reference
49    |                   `f` is a `&` reference, so the data it refers to cannot be moved
50
51 error[E0507]: cannot move out of `f.0` which is behind a `&` reference
52   --> $DIR/borrowck-move-error-with-note.rs:25:19
53    |
54 LL |     let f = &Foo::Foo1(box 1, box 2);
55    |             ------------------------ help: consider changing this to be a mutable reference: `&mut Foo::Foo1(box 1, box 2)`
56 ...
57 LL |         Foo::Foo2(num) => (),
58    |                   ^^^
59    |                   |
60    |                   cannot move out of `f.0` which is behind a `&` reference
61    |                   `f` is a `&` reference, so the data it refers to cannot be moved
62
63 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
64   --> $DIR/borrowck-move-error-with-note.rs:39:11
65    |
66 LL |     match (S {f: "foo".to_string(), g: "bar".to_string()}) {
67    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here
68 ...
69 LL |             f: _s,
70    |                -- data moved here
71 LL |             g: _t
72    |                -- ...and here
73    |
74 note: move occurs because these variables have types that don't implement the `Copy` trait
75   --> $DIR/borrowck-move-error-with-note.rs:42:16
76    |
77 LL |             f: _s,
78    |                ^^
79 LL |             g: _t
80    |                ^^
81
82 error[E0507]: cannot move out of borrowed content
83   --> $DIR/borrowck-move-error-with-note.rs:57:11
84    |
85 LL |     match a.a {           //~ ERROR cannot move out of
86    |           ^^^
87    |           |
88    |           cannot move out of borrowed content
89    |           help: consider borrowing here: `&a.a`
90 LL |                           //~| cannot move out
91 LL |         n => {
92    |         - data moved here
93    |
94 note: move occurs because `n` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
95   --> $DIR/borrowck-move-error-with-note.rs:59:9
96    |
97 LL |         n => {
98    |         ^
99
100 error[E0507]: cannot move out of `a.a` which is behind a `&` reference
101   --> $DIR/borrowck-move-error-with-note.rs:59:9
102    |
103 LL |     let a = &A { a: box 1 };
104    |             --------------- help: consider changing this to be a mutable reference: `&mut A { a: box 1 }`
105 ...
106 LL |         n => {
107    |         ^
108    |         |
109    |         cannot move out of `a.a` which is behind a `&` reference
110    |         `a` is a `&` reference, so the data it refers to cannot be moved
111
112 error: aborting due to 7 previous errors
113
114 Some errors occurred: E0507, E0509.
115 For more information about an error, try `rustc --explain E0507`.