fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
7.2 KiB154 linesraw
1error[E0503]: cannot use `self.cx` because it was mutably borrowed
2  --> $DIR/two-phase-surprise-no-conflict.rs:21:23
3   |
4LL |         let _mut_borrow = &mut *self;
5   |                           ---------- borrow of `*self` occurs here
6LL |         let _access = self.cx;
7   |                       ^^^^^^^ use of borrowed `*self`
8LL |
9LL |         _mut_borrow;
10   |         ----------- borrow later used here
11
12error[E0502]: cannot borrow `*self` as mutable because it is also borrowed as immutable
13  --> $DIR/two-phase-surprise-no-conflict.rs:57:17
14   |
15LL |                 self.hash_expr(&self.cx_mut.body(eid).value);
16   |                 ^^^^^---------^^-----------^^^^^^^^^^^^^^^^^
17   |                 |    |          |
18   |                 |    |          immutable borrow occurs here
19   |                 |    immutable borrow later used by call
20   |                 mutable borrow occurs here
21
22error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
23  --> $DIR/two-phase-surprise-no-conflict.rs:119:51
24   |
25LL |     reg.register_static(Box::new(TrivialPass::new(&mut reg.sess_mut)));
26   |     --- ---------------                           ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
27   |     |   |
28   |     |   first borrow later used by call
29   |     first mutable borrow occurs here
30
31error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
32  --> $DIR/two-phase-surprise-no-conflict.rs:122:54
33   |
34LL |     reg.register_bound(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
35   |     --- --------------                               ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
36   |     |   |
37   |     |   first borrow later used by call
38   |     first mutable borrow occurs here
39
40error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
41  --> $DIR/two-phase-surprise-no-conflict.rs:125:53
42   |
43LL |     reg.register_univ(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
44   |     --- -------------                               ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
45   |     |   |
46   |     |   first borrow later used by call
47   |     first mutable borrow occurs here
48
49error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
50  --> $DIR/two-phase-surprise-no-conflict.rs:128:44
51   |
52LL |     reg.register_ref(&TrivialPass::new_mut(&mut reg.sess_mut));
53   |     --- ------------                       ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
54   |     |   |
55   |     |   first borrow later used by call
56   |     first mutable borrow occurs here
57
58error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
59  --> $DIR/two-phase-surprise-no-conflict.rs:138:5
60   |
61LL |     reg.register_bound(Box::new(CapturePass::new(&reg.sess_mut)));
62   |     ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^^^
63   |     |   |                                        |
64   |     |   |                                        immutable borrow occurs here
65   |     |   immutable borrow later used by call
66   |     mutable borrow occurs here
67
68error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
69  --> $DIR/two-phase-surprise-no-conflict.rs:141:5
70   |
71LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) {
72   |                     -- lifetime `'a` defined here
73...
74LL |     reg.register_univ(Box::new(CapturePass::new(&reg.sess_mut)));
75   |     ^^^^^^^^^^^^^^^^^^-----------------------------------------^
76   |     |                 |                         |
77   |     |                 |                         immutable borrow occurs here
78   |     |                 cast requires that `reg.sess_mut` is borrowed for `'a`
79   |     mutable borrow occurs here
80
81error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
82  --> $DIR/two-phase-surprise-no-conflict.rs:144:5
83   |
84LL |     reg.register_ref(&CapturePass::new(&reg.sess_mut));
85   |     ^^^^------------^^^^^^^^^^^^^^^^^^^-------------^^
86   |     |   |                              |
87   |     |   |                              immutable borrow occurs here
88   |     |   immutable borrow later used by call
89   |     mutable borrow occurs here
90
91error[E0499]: cannot borrow `*reg` as mutable more than once at a time
92  --> $DIR/two-phase-surprise-no-conflict.rs:154:5
93   |
94LL |     reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
95   |     ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^^^
96   |     |   |                                            |
97   |     |   |                                            first mutable borrow occurs here
98   |     |   first borrow later used by call
99   |     second mutable borrow occurs here
100
101error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
102  --> $DIR/two-phase-surprise-no-conflict.rs:154:54
103   |
104LL |     reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
105   |     --- --------------                               ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
106   |     |   |
107   |     |   first borrow later used by call
108   |     first mutable borrow occurs here
109
110error[E0499]: cannot borrow `*reg` as mutable more than once at a time
111  --> $DIR/two-phase-surprise-no-conflict.rs:158:5
112   |
113LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) {
114   |                     -- lifetime `'a` defined here
115...
116LL |     reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
117   |     ^^^^^^^^^^^^^^^^^^-------------------------------------------------^
118   |     |                 |                             |
119   |     |                 |                             first mutable borrow occurs here
120   |     |                 cast requires that `reg.sess_mut` is borrowed for `'a`
121   |     second mutable borrow occurs here
122
123error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
124  --> $DIR/two-phase-surprise-no-conflict.rs:158:53
125   |
126LL |     reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
127   |     --- -------------                               ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
128   |     |   |
129   |     |   first borrow later used by call
130   |     first mutable borrow occurs here
131
132error[E0499]: cannot borrow `*reg` as mutable more than once at a time
133  --> $DIR/two-phase-surprise-no-conflict.rs:162:5
134   |
135LL |     reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
136   |     ^^^^------------^^^^^^^^^^^^^^^^^^^^^^^-----------------^^
137   |     |   |                                  |
138   |     |   |                                  first mutable borrow occurs here
139   |     |   first borrow later used by call
140   |     second mutable borrow occurs here
141
142error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
143  --> $DIR/two-phase-surprise-no-conflict.rs:162:44
144   |
145LL |     reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
146   |     --- ------------                       ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
147   |     |   |
148   |     |   first borrow later used by call
149   |     first mutable borrow occurs here
150
151error: aborting due to 15 previous errors
152
153Some errors have detailed explanations: E0499, E0502, E0503.
154For more information about an error, try `rustc --explain E0499`.