]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-use-mut-borrow.stderr
Rollup merge of #106570 - Xaeroxe:div-duration-tests, r=JohnTitor
[rust.git] / tests / ui / borrowck / borrowck-use-mut-borrow.stderr
1 error[E0503]: cannot use `x` because it was mutably borrowed
2   --> $DIR/borrowck-use-mut-borrow.rs:11:10
3    |
4 LL |     let p = &mut x;
5    |             ------ borrow of `x` occurs here
6 LL |     drop(x);
7    |          ^ use of borrowed `x`
8 LL |     *p = 2;
9    |     ------ borrow later used here
10
11 error[E0503]: cannot use `x` because it was mutably borrowed
12   --> $DIR/borrowck-use-mut-borrow.rs:18:10
13    |
14 LL |     let p = &mut x.a;
15    |             -------- borrow of `x.a` occurs here
16 LL |     drop(x);
17    |          ^ use of borrowed `x.a`
18 LL |     *p = 3;
19    |     ------ borrow later used here
20
21 error[E0503]: cannot use `x.a` because it was mutably borrowed
22   --> $DIR/borrowck-use-mut-borrow.rs:25:10
23    |
24 LL |     let p = &mut x;
25    |             ------ borrow of `x` occurs here
26 LL |     drop(x.a);
27    |          ^^^ use of borrowed `x`
28 LL |     p.a = 3;
29    |     ------- borrow later used here
30
31 error[E0503]: cannot use `x.a` because it was mutably borrowed
32   --> $DIR/borrowck-use-mut-borrow.rs:32:10
33    |
34 LL |     let p = &mut x.a;
35    |             -------- borrow of `x.a` occurs here
36 LL |     drop(x.a);
37    |          ^^^ use of borrowed `x.a`
38 LL |     *p = 3;
39    |     ------ borrow later used here
40
41 error[E0503]: cannot use `x.a` because it was mutably borrowed
42   --> $DIR/borrowck-use-mut-borrow.rs:39:13
43    |
44 LL |     let p = &mut x;
45    |             ------ borrow of `x` occurs here
46 LL |     let y = A { b: 3, .. x };
47    |             ^^^^^^^^^^^^^^^^ use of borrowed `x`
48 LL |     drop(y);
49 LL |     p.a = 4;
50    |     ------- borrow later used here
51
52 error[E0503]: cannot use `x.a` because it was mutably borrowed
53   --> $DIR/borrowck-use-mut-borrow.rs:47:13
54    |
55 LL |     let p = &mut x.a;
56    |             -------- borrow of `x.a` occurs here
57 LL |     let y = A { b: 3, .. x };
58    |             ^^^^^^^^^^^^^^^^ use of borrowed `x.a`
59 LL |     drop(y);
60 LL |     *p = 4;
61    |     ------ borrow later used here
62
63 error[E0503]: cannot use `*x` because it was mutably borrowed
64   --> $DIR/borrowck-use-mut-borrow.rs:55:10
65    |
66 LL |     let p = &mut x;
67    |             ------ borrow of `x` occurs here
68 LL |     drop(*x);
69    |          ^^ use of borrowed `x`
70 LL |     **p = 2;
71    |     ------- borrow later used here
72
73 error[E0503]: cannot use `*x.b` because it was mutably borrowed
74   --> $DIR/borrowck-use-mut-borrow.rs:62:10
75    |
76 LL |     let p = &mut x;
77    |             ------ borrow of `x` occurs here
78 LL |     drop(*x.b);
79    |          ^^^^ use of borrowed `x`
80 LL |     p.a = 3;
81    |     ------- borrow later used here
82
83 error[E0503]: cannot use `*x.b` because it was mutably borrowed
84   --> $DIR/borrowck-use-mut-borrow.rs:69:10
85    |
86 LL |     let p = &mut x.b;
87    |             -------- borrow of `x.b` occurs here
88 LL |     drop(*x.b);
89    |          ^^^^ use of borrowed `x.b`
90 LL |     **p = 3;
91    |     ------- borrow later used here
92
93 error: aborting due to 9 previous errors
94
95 For more information about this error, try `rustc --explain E0503`.