]> git.proxmox.com Git - rustc.git/blob - src/test/ui/borrowck/borrowck-describe-lvalue.ast.stderr
New upstream version 1.33.0+dfsg1
[rustc.git] / src / test / ui / borrowck / borrowck-describe-lvalue.ast.stderr
1 error[E0503]: cannot use `f.x` because it was mutably borrowed
2 --> $DIR/borrowck-describe-lvalue.rs:43:9
3 |
4 LL | let x = f.x();
5 | - borrow of `f` occurs here
6 LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed
7 | ^^^ use of borrowed `f`
8
9 error[E0503]: cannot use `g.0` because it was mutably borrowed
10 --> $DIR/borrowck-describe-lvalue.rs:51:9
11 |
12 LL | let x = g.x();
13 | - borrow of `g` occurs here
14 LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed
15 | ^^^ use of borrowed `g`
16
17 error[E0503]: cannot use `h.0` because it was mutably borrowed
18 --> $DIR/borrowck-describe-lvalue.rs:59:9
19 |
20 LL | let x = &mut h.0;
21 | --- borrow of `h.0` occurs here
22 LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed
23 | ^^^ use of borrowed `h.0`
24
25 error[E0503]: cannot use `e.0` because it was mutably borrowed
26 --> $DIR/borrowck-describe-lvalue.rs:68:20
27 |
28 LL | let x = e.x();
29 | - borrow of `e` occurs here
30 LL | match e {
31 LL | Baz::X(value) => value
32 | ^^^^^ use of borrowed `e`
33
34 error[E0503]: cannot use `u.a` because it was mutably borrowed
35 --> $DIR/borrowck-describe-lvalue.rs:78:9
36 |
37 LL | let x = &mut u.a;
38 | --- borrow of `u.a` occurs here
39 LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed
40 | ^^^ use of borrowed `u.a`
41
42 error[E0503]: cannot use `f.x` because it was mutably borrowed
43 --> $DIR/borrowck-describe-lvalue.rs:86:9
44 |
45 LL | let x = f.x();
46 | - borrow of `*f` occurs here
47 LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed
48 | ^^^ use of borrowed `*f`
49
50 error[E0503]: cannot use `g.0` because it was mutably borrowed
51 --> $DIR/borrowck-describe-lvalue.rs:94:9
52 |
53 LL | let x = g.x();
54 | - borrow of `*g` occurs here
55 LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed
56 | ^^^ use of borrowed `*g`
57
58 error[E0503]: cannot use `h.0` because it was mutably borrowed
59 --> $DIR/borrowck-describe-lvalue.rs:102:9
60 |
61 LL | let x = &mut h.0;
62 | --- borrow of `h.0` occurs here
63 LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed
64 | ^^^ use of borrowed `h.0`
65
66 error[E0503]: cannot use `e.0` because it was mutably borrowed
67 --> $DIR/borrowck-describe-lvalue.rs:111:20
68 |
69 LL | let x = e.x();
70 | - borrow of `*e` occurs here
71 LL | match *e {
72 LL | Baz::X(value) => value
73 | ^^^^^ use of borrowed `*e`
74
75 error[E0503]: cannot use `u.a` because it was mutably borrowed
76 --> $DIR/borrowck-describe-lvalue.rs:121:9
77 |
78 LL | let x = &mut u.a;
79 | --- borrow of `u.a` occurs here
80 LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed
81 | ^^^ use of borrowed `u.a`
82
83 error[E0503]: cannot use `v[..]` because it was mutably borrowed
84 --> $DIR/borrowck-describe-lvalue.rs:130:15
85 |
86 LL | let x = &mut v;
87 | - borrow of `v` occurs here
88 LL | match v {
89 LL | &[x, _, .., _, _] => println!("{}", x),
90 | ^ use of borrowed `v`
91
92 error[E0503]: cannot use `v[..]` because it was mutably borrowed
93 --> $DIR/borrowck-describe-lvalue.rs:136:18
94 |
95 LL | let x = &mut v;
96 | - borrow of `v` occurs here
97 ...
98 LL | &[_, x, .., _, _] => println!("{}", x),
99 | ^ use of borrowed `v`
100
101 error[E0503]: cannot use `v[..]` because it was mutably borrowed
102 --> $DIR/borrowck-describe-lvalue.rs:142:25
103 |
104 LL | let x = &mut v;
105 | - borrow of `v` occurs here
106 ...
107 LL | &[_, _, .., x, _] => println!("{}", x),
108 | ^ use of borrowed `v`
109
110 error[E0503]: cannot use `v[..]` because it was mutably borrowed
111 --> $DIR/borrowck-describe-lvalue.rs:148:28
112 |
113 LL | let x = &mut v;
114 | - borrow of `v` occurs here
115 ...
116 LL | &[_, _, .., _, x] => println!("{}", x),
117 | ^ use of borrowed `v`
118
119 error[E0503]: cannot use `v[..]` because it was mutably borrowed
120 --> $DIR/borrowck-describe-lvalue.rs:160:15
121 |
122 LL | let x = &mut v;
123 | - borrow of `v` occurs here
124 LL | match v {
125 LL | &[x..] => println!("{:?}", x),
126 | ^ use of borrowed `v`
127
128 error[E0503]: cannot use `v[..]` because it was mutably borrowed
129 --> $DIR/borrowck-describe-lvalue.rs:166:18
130 |
131 LL | let x = &mut v;
132 | - borrow of `v` occurs here
133 ...
134 LL | &[_, x..] => println!("{:?}", x),
135 | ^ use of borrowed `v`
136
137 error[E0503]: cannot use `v[..]` because it was mutably borrowed
138 --> $DIR/borrowck-describe-lvalue.rs:172:15
139 |
140 LL | let x = &mut v;
141 | - borrow of `v` occurs here
142 ...
143 LL | &[x.., _] => println!("{:?}", x),
144 | ^ use of borrowed `v`
145
146 error[E0503]: cannot use `v[..]` because it was mutably borrowed
147 --> $DIR/borrowck-describe-lvalue.rs:178:18
148 |
149 LL | let x = &mut v;
150 | - borrow of `v` occurs here
151 ...
152 LL | &[_, x.., _] => println!("{:?}", x),
153 | ^ use of borrowed `v`
154
155 error[E0502]: cannot borrow `e.0` as immutable because `e` is also borrowed as mutable
156 --> $DIR/borrowck-describe-lvalue.rs:192:18
157 |
158 LL | let x = &mut e;
159 | - mutable borrow occurs here
160 LL | match e {
161 LL | E::A(ref ax) =>
162 | ^^^^^^ immutable borrow occurs here
163 ...
164 LL | }
165 | - mutable borrow ends here
166
167 error[E0502]: cannot borrow `e.x` as immutable because `e` is also borrowed as mutable
168 --> $DIR/borrowck-describe-lvalue.rs:197:23
169 |
170 LL | let x = &mut e;
171 | - mutable borrow occurs here
172 ...
173 LL | E::B { x: ref bx } =>
174 | ^^^^^^ immutable borrow occurs here
175 ...
176 LL | }
177 | - mutable borrow ends here
178
179 error[E0502]: cannot borrow `s.y.0` as immutable because `s` is also borrowed as mutable
180 --> $DIR/borrowck-describe-lvalue.rs:211:22
181 |
182 LL | let x = &mut s;
183 | - mutable borrow occurs here
184 LL | match s {
185 LL | S { y: (ref y0, _), .. } =>
186 | ^^^^^^ immutable borrow occurs here
187 ...
188 LL | }
189 | - mutable borrow ends here
190
191 error[E0502]: cannot borrow `s.x.y` as immutable because `s` is also borrowed as mutable
192 --> $DIR/borrowck-describe-lvalue.rs:218:28
193 |
194 LL | let x = &mut s;
195 | - mutable borrow occurs here
196 ...
197 LL | S { x: F { y: ref x0, .. }, .. } =>
198 | ^^^^^^ immutable borrow occurs here
199 ...
200 LL | }
201 | - mutable borrow ends here
202
203 error[E0503]: cannot use `v[..].y` because it was mutably borrowed
204 --> $DIR/borrowck-describe-lvalue.rs:261:9
205 |
206 LL | let x = &mut v;
207 | - borrow of `v` occurs here
208 LL | v[0].y;
209 | ^^^^^^ use of borrowed `v`
210
211 error[E0499]: cannot borrow `**x` as mutable more than once at a time
212 --> $DIR/borrowck-describe-lvalue.rs:285:18
213 |
214 LL | let y = &mut x;
215 | - first mutable borrow occurs here
216 LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
217 | ^ second mutable borrow occurs here
218 ...
219 LL | };
220 | - first borrow ends here
221
222 error[E0499]: cannot borrow `**x` as mutable more than once at a time
223 --> $DIR/borrowck-describe-lvalue.rs:296:25
224 |
225 LL | let y = &mut x;
226 | - first mutable borrow occurs here
227 LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time
228 | ^ second mutable borrow occurs here
229 ...
230 LL | }
231 | - first borrow ends here
232
233 error[E0382]: use of moved value: `x`
234 --> $DIR/borrowck-describe-lvalue.rs:307:22
235 |
236 LL | drop(x);
237 | - value moved here
238 LL | drop(x); //[ast]~ ERROR use of moved value: `x`
239 | ^ value used here after move
240 |
241 = note: move occurs because `x` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait
242
243 error: aborting due to 26 previous errors
244
245 Some errors occurred: E0382, E0499, E0502, E0503.
246 For more information about an error, try `rustc --explain E0382`.