fork/rust

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

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

1.39.0
6.9 KiB148 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 |     reg.register_univ(Box::new(CapturePass::new(&reg.sess_mut)));
72   |     ^^^^-------------^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^^^
73   |     |   |                                       |
74   |     |   |                                       immutable borrow occurs here
75   |     |   immutable borrow later used by call
76   |     mutable borrow occurs here
77
78error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
79  --> $DIR/two-phase-surprise-no-conflict.rs:144:5
80   |
81LL |     reg.register_ref(&CapturePass::new(&reg.sess_mut));
82   |     ^^^^------------^^^^^^^^^^^^^^^^^^^-------------^^
83   |     |   |                              |
84   |     |   |                              immutable borrow occurs here
85   |     |   immutable borrow later used by call
86   |     mutable borrow occurs here
87
88error[E0499]: cannot borrow `*reg` as mutable more than once at a time
89  --> $DIR/two-phase-surprise-no-conflict.rs:154:5
90   |
91LL |     reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
92   |     ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^^^
93   |     |   |                                            |
94   |     |   |                                            first mutable borrow occurs here
95   |     |   first borrow later used by call
96   |     second mutable borrow occurs here
97
98error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
99  --> $DIR/two-phase-surprise-no-conflict.rs:154:54
100   |
101LL |     reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
102   |     --- --------------                               ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
103   |     |   |
104   |     |   first borrow later used by call
105   |     first mutable borrow occurs here
106
107error[E0499]: cannot borrow `*reg` as mutable more than once at a time
108  --> $DIR/two-phase-surprise-no-conflict.rs:158:5
109   |
110LL |     reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
111   |     ^^^^-------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^^^
112   |     |   |                                           |
113   |     |   |                                           first mutable borrow occurs here
114   |     |   first borrow later used by call
115   |     second mutable borrow occurs here
116
117error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
118  --> $DIR/two-phase-surprise-no-conflict.rs:158:53
119   |
120LL |     reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
121   |     --- -------------                               ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
122   |     |   |
123   |     |   first borrow later used by call
124   |     first mutable borrow occurs here
125
126error[E0499]: cannot borrow `*reg` as mutable more than once at a time
127  --> $DIR/two-phase-surprise-no-conflict.rs:162:5
128   |
129LL |     reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
130   |     ^^^^------------^^^^^^^^^^^^^^^^^^^^^^^-----------------^^
131   |     |   |                                  |
132   |     |   |                                  first mutable borrow occurs here
133   |     |   first borrow later used by call
134   |     second mutable borrow occurs here
135
136error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
137  --> $DIR/two-phase-surprise-no-conflict.rs:162:44
138   |
139LL |     reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
140   |     --- ------------                       ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
141   |     |   |
142   |     |   first borrow later used by call
143   |     first mutable borrow occurs here
144
145error: aborting due to 15 previous errors
146
147Some errors have detailed explanations: E0499, E0502, E0503.
148For more information about an error, try `rustc --explain E0499`.