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