]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-assign-comp.stderr
Move /src/test to /tests
[rust.git] / tests / ui / borrowck / borrowck-assign-comp.stderr
1 error[E0506]: cannot assign to `p.x` because it is borrowed
2   --> $DIR/borrowck-assign-comp.rs:10:5
3    |
4 LL |     let q = &p;
5    |             -- borrow of `p.x` occurs here
6 ...
7 LL |     p.x = 5;
8    |     ^^^^^^^ assignment to borrowed `p.x` occurs here
9 LL |     q.x;
10    |     --- borrow later used here
11
12 error[E0506]: cannot assign to `p` because it is borrowed
13   --> $DIR/borrowck-assign-comp.rs:20:5
14    |
15 LL |     let q = &p.y;
16    |             ---- borrow of `p` occurs here
17 LL |     p = Point {x: 5, y: 7};
18    |     ^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `p` occurs here
19 LL |     p.x; // silence warning
20 LL |     *q; // stretch loan
21    |     -- borrow later used here
22
23 error[E0506]: cannot assign to `p.y` because it is borrowed
24   --> $DIR/borrowck-assign-comp.rs:31:5
25    |
26 LL |     let q = &p.y;
27    |             ---- borrow of `p.y` occurs here
28 LL |     p.y = 5;
29    |     ^^^^^^^ assignment to borrowed `p.y` occurs here
30 LL |     *q;
31    |     -- borrow later used here
32
33 error: aborting due to 3 previous errors
34
35 For more information about this error, try `rustc --explain E0506`.