summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/two-phase-surprise-no-conflict.stderr
blob: e75094d4f1309eba7f17640e89c340de14195a6f (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
error[E0503]: cannot use `self.cx` because it was mutably borrowed
  --> $DIR/two-phase-surprise-no-conflict.rs:21:23
   |
LL |         let _mut_borrow = &mut *self;
   |                           ---------- `*self` is borrowed here
LL |         let _access = self.cx;
   |                       ^^^^^^^ use of borrowed `*self`
LL |
LL |         _mut_borrow;
   |         ----------- borrow later used here

error[E0502]: cannot borrow `*self` as mutable because it is also borrowed as immutable
  --> $DIR/two-phase-surprise-no-conflict.rs:57:17
   |
LL |                 self.hash_expr(&self.cx_mut.body(eid).value);
   |                 ^^^^^---------^^---------------------^^^^^^^
   |                 |    |          |
   |                 |    |          immutable borrow occurs here
   |                 |    immutable borrow later used by call
   |                 mutable borrow occurs here

error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
  --> $DIR/two-phase-surprise-no-conflict.rs:119:51
   |
LL |     reg.register_static(Box::new(TrivialPass::new(&mut reg.sess_mut)));
   |     ----------------------------------------------^^^^^^^^^^^^^^^^^---
   |     |   |                                         |
   |     |   |                                         second mutable borrow occurs here
   |     |   first borrow later used by call
   |     first mutable borrow occurs here

error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
  --> $DIR/two-phase-surprise-no-conflict.rs:122:54
   |
LL |     reg.register_bound(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
   |     -------------------------------------------------^^^^^^^^^^^^^^^^^---
   |     |   |                                            |
   |     |   |                                            second mutable borrow occurs here
   |     |   first borrow later used by call
   |     first mutable borrow occurs here

error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
  --> $DIR/two-phase-surprise-no-conflict.rs:125:53
   |
LL |     reg.register_univ(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
   |     ------------------------------------------------^^^^^^^^^^^^^^^^^---
   |     |   |                                           |
   |     |   |                                           second mutable borrow occurs here
   |     |   first borrow later used by call
   |     first mutable borrow occurs here

error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
  --> $DIR/two-phase-surprise-no-conflict.rs:128:44
   |
LL |     reg.register_ref(&TrivialPass::new_mut(&mut reg.sess_mut));
   |     ---------------------------------------^^^^^^^^^^^^^^^^^--
   |     |   |                                  |
   |     |   |                                  second mutable borrow occurs here
   |     |   first borrow later used by call
   |     first mutable borrow occurs here

error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
  --> $DIR/two-phase-surprise-no-conflict.rs:138:5
   |
LL |     reg.register_bound(Box::new(CapturePass::new(&reg.sess_mut)));
   |     ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^^^
   |     |   |                                        |
   |     |   |                                        immutable borrow occurs here
   |     |   immutable borrow later used by call
   |     mutable borrow occurs here

error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
  --> $DIR/two-phase-surprise-no-conflict.rs:141:5
   |
LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) {
   |                     -- lifetime `'a` defined here
...
LL |     reg.register_univ(Box::new(CapturePass::new(&reg.sess_mut)));
   |     ^^^^^^^^^^^^^^^^^^-----------------------------------------^
   |     |                 |                         |
   |     |                 |                         immutable borrow occurs here
   |     |                 cast requires that `reg.sess_mut` is borrowed for `'a`
   |     mutable borrow occurs here

error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
  --> $DIR/two-phase-surprise-no-conflict.rs:144:5
   |
LL |     reg.register_ref(&CapturePass::new(&reg.sess_mut));
   |     ^^^^------------^^^^^^^^^^^^^^^^^^^-------------^^
   |     |   |                              |
   |     |   |                              immutable borrow occurs here
   |     |   immutable borrow later used by call
   |     mutable borrow occurs here

error[E0499]: cannot borrow `*reg` as mutable more than once at a time
  --> $DIR/two-phase-surprise-no-conflict.rs:154:5
   |
LL |     reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
   |     ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^^^
   |     |   |                                            |
   |     |   |                                            first mutable borrow occurs here
   |     |   first borrow later used by call
   |     second mutable borrow occurs here

error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
  --> $DIR/two-phase-surprise-no-conflict.rs:154:54
   |
LL |     reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
   |     -------------------------------------------------^^^^^^^^^^^^^^^^^---
   |     |   |                                            |
   |     |   |                                            second mutable borrow occurs here
   |     |   first borrow later used by call
   |     first mutable borrow occurs here

error[E0499]: cannot borrow `*reg` as mutable more than once at a time
  --> $DIR/two-phase-surprise-no-conflict.rs:158:5
   |
LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) {
   |                     -- lifetime `'a` defined here
...
LL |     reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
   |     ^^^^^^^^^^^^^^^^^^-------------------------------------------------^
   |     |                 |                             |
   |     |                 |                             first mutable borrow occurs here
   |     |                 cast requires that `reg.sess_mut` is borrowed for `'a`
   |     second mutable borrow occurs here

error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
  --> $DIR/two-phase-surprise-no-conflict.rs:158:53
   |
LL |     reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
   |     ------------------------------------------------^^^^^^^^^^^^^^^^^---
   |     |   |                                           |
   |     |   |                                           second mutable borrow occurs here
   |     |   first borrow later used by call
   |     first mutable borrow occurs here

error[E0499]: cannot borrow `*reg` as mutable more than once at a time
  --> $DIR/two-phase-surprise-no-conflict.rs:162:5
   |
LL |     reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
   |     ^^^^------------^^^^^^^^^^^^^^^^^^^^^^^-----------------^^
   |     |   |                                  |
   |     |   |                                  first mutable borrow occurs here
   |     |   first borrow later used by call
   |     second mutable borrow occurs here

error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
  --> $DIR/two-phase-surprise-no-conflict.rs:162:44
   |
LL |     reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
   |     ---------------------------------------^^^^^^^^^^^^^^^^^--
   |     |   |                                  |
   |     |   |                                  second mutable borrow occurs here
   |     |   first borrow later used by call
   |     first mutable borrow occurs here

error: aborting due to 15 previous errors

Some errors have detailed explanations: E0499, E0502, E0503.
For more information about an error, try `rustc --explain E0499`.