]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-box-insensitivity.ast.stderr
Rollup merge of #57480 - Zoxc:query-fix, r=michaelwoerister
[rust.git] / src / test / ui / borrowck / borrowck-box-insensitivity.ast.stderr
1 error[E0382]: use of moved value: `a`
2   --> $DIR/borrowck-box-insensitivity.rs:37:9
3    |
4 LL |     let _x = a.x;
5    |         -- value moved here
6 LL |     //[ast]~^ value moved here
7 LL |     let _y = a.y; //[ast]~ ERROR use of moved
8    |         ^^ value used here after move
9    |
10    = note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
11
12 error[E0382]: use of moved value: `a`
13   --> $DIR/borrowck-box-insensitivity.rs:46:9
14    |
15 LL |     let _x = a.x;
16    |         -- value moved here
17 LL |     //[ast]~^ value moved here
18 LL |     let _y = a.y; //[ast]~ ERROR use of moved
19    |         ^^ value used here after move
20    |
21    = note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
22
23 error[E0382]: use of moved value: `a`
24   --> $DIR/borrowck-box-insensitivity.rs:55:15
25    |
26 LL |     let _x = a.x;
27    |         -- value moved here
28 LL |     //[ast]~^ value moved here
29 LL |     let _y = &a.y; //[ast]~ ERROR use of moved
30    |               ^^^ value used here after move
31    |
32    = note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
33
34 error[E0505]: cannot move out of `a.y` because it is borrowed
35   --> $DIR/borrowck-box-insensitivity.rs:63:9
36    |
37 LL |     let _x = &a.x;
38    |               --- borrow of `a.x` occurs here
39 LL |     let _y = a.y;
40    |         ^^ move out of `a.y` occurs here
41
42 error[E0503]: cannot use `a.y` because it was mutably borrowed
43   --> $DIR/borrowck-box-insensitivity.rs:71:9
44    |
45 LL |     let _x = &mut a.x;
46    |                   --- borrow of `a.x` occurs here
47 LL |     let _y = a.y; //[ast]~ ERROR cannot use
48    |         ^^ use of borrowed `a.x`
49
50 error[E0505]: cannot move out of `a.y` because it is borrowed
51   --> $DIR/borrowck-box-insensitivity.rs:77:9
52    |
53 LL |     let _x = &mut a.x;
54    |                   --- borrow of `a.x` occurs here
55 LL |     let _y = a.y;
56    |         ^^ move out of `a.y` occurs here
57
58 error[E0502]: cannot borrow `a` (via `a.y`) as immutable because `a` is also borrowed as mutable (via `a.x`)
59   --> $DIR/borrowck-box-insensitivity.rs:85:15
60    |
61 LL |     let _x = &mut a.x;
62    |                   --- mutable borrow occurs here (via `a.x`)
63 LL |     let _y = &a.y; //[ast]~ ERROR cannot borrow
64    |               ^^^ immutable borrow of `a.y` -- which overlaps with `a.x` -- occurs here
65 ...
66 LL | }
67    | - mutable borrow ends here
68
69 error[E0502]: cannot borrow `a` (via `a.y`) as mutable because `a` is also borrowed as immutable (via `a.x`)
70   --> $DIR/borrowck-box-insensitivity.rs:92:19
71    |
72 LL |     let _x = &a.x;
73    |               --- immutable borrow occurs here (via `a.x`)
74 LL |     let _y = &mut a.y; //[ast]~ ERROR cannot borrow
75    |                   ^^^ mutable borrow of `a.y` -- which overlaps with `a.x` -- occurs here
76 ...
77 LL | }
78    | - immutable borrow ends here
79
80 error[E0382]: use of collaterally moved value: `a.y`
81   --> $DIR/borrowck-box-insensitivity.rs:100:9
82    |
83 LL |     let _x = a.x.x;
84    |         -- value moved here
85 LL |     //[ast]~^ value moved here
86 LL |     let _y = a.y; //[ast]~ ERROR use of collaterally moved
87    |         ^^ value used here after move
88    |
89    = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
90
91 error[E0382]: use of collaterally moved value: `a.y`
92   --> $DIR/borrowck-box-insensitivity.rs:108:9
93    |
94 LL |     let _x = a.x.x;
95    |         -- value moved here
96 LL |     //[ast]~^ value moved here
97 LL |     let _y = a.y; //[ast]~ ERROR use of collaterally moved
98    |         ^^ value used here after move
99    |
100    = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
101
102 error[E0382]: use of collaterally moved value: `a.y`
103   --> $DIR/borrowck-box-insensitivity.rs:116:15
104    |
105 LL |     let _x = a.x.x;
106    |         -- value moved here
107 LL |     //[ast]~^ value moved here
108 LL |     let _y = &a.y; //[ast]~ ERROR use of collaterally moved
109    |               ^^^ value used here after move
110    |
111    = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
112
113 error[E0505]: cannot move out of `a.y` because it is borrowed
114   --> $DIR/borrowck-box-insensitivity.rs:124:9
115    |
116 LL |     let _x = &a.x.x;
117    |               ----- borrow of `a.x.x` occurs here
118 LL |     //[ast]~^ borrow of `a.x.x` occurs here
119 LL |     let _y = a.y;
120    |         ^^ move out of `a.y` occurs here
121
122 error[E0503]: cannot use `a.y` because it was mutably borrowed
123   --> $DIR/borrowck-box-insensitivity.rs:132:9
124    |
125 LL |     let _x = &mut a.x.x;
126    |                   ----- borrow of `a.x.x` occurs here
127 LL |     let _y = a.y; //[ast]~ ERROR cannot use
128    |         ^^ use of borrowed `a.x.x`
129
130 error[E0505]: cannot move out of `a.y` because it is borrowed
131   --> $DIR/borrowck-box-insensitivity.rs:138:9
132    |
133 LL |     let _x = &mut a.x.x;
134    |                   ----- borrow of `a.x.x` occurs here
135 LL |     let _y = a.y;
136    |         ^^ move out of `a.y` occurs here
137
138 error[E0502]: cannot borrow `a.y` as immutable because `a.x.x` is also borrowed as mutable
139   --> $DIR/borrowck-box-insensitivity.rs:147:15
140    |
141 LL |     let _x = &mut a.x.x;
142    |                   ----- mutable borrow occurs here
143 LL |     //[ast]~^ mutable borrow occurs here
144 LL |     let _y = &a.y; //[ast]~ ERROR cannot borrow
145    |               ^^^ immutable borrow occurs here
146 ...
147 LL | }
148    | - mutable borrow ends here
149
150 error[E0502]: cannot borrow `a.y` as mutable because `a.x.x` is also borrowed as immutable
151   --> $DIR/borrowck-box-insensitivity.rs:155:19
152    |
153 LL |     let _x = &a.x.x;
154    |               ----- immutable borrow occurs here
155 LL |     //[ast]~^ immutable borrow occurs here
156 LL |     let _y = &mut a.y; //[ast]~ ERROR cannot borrow
157    |                   ^^^ mutable borrow occurs here
158 ...
159 LL | }
160    | - immutable borrow ends here
161
162 error: aborting due to 16 previous errors
163
164 Some errors occurred: E0382, E0502, E0503, E0505.
165 For more information about an error, try `rustc --explain E0382`.