@@ -92,28 +92,28 @@ pub fn gather_loans(bccx: @BorrowckCtxt,
92
92
visit_pat : add_pat_to_id_range,
93
93
visit_local : gather_loans_in_local,
94
94
.. * visit:: default_visitor ( ) } ) ;
95
- ( v. visit_block ) ( body, glcx, v) ;
95
+ ( v. visit_block ) ( body, ( glcx, v) ) ;
96
96
return ( glcx. id_range , glcx. all_loans , glcx. move_data ) ;
97
97
}
98
98
99
99
fn add_pat_to_id_range ( p : @ast:: pat ,
100
- this : @mut GatherLoanCtxt ,
101
- v : visit:: vt < @mut GatherLoanCtxt > ) {
100
+ ( this, v ) : ( @mut GatherLoanCtxt ,
101
+ visit:: vt < @mut GatherLoanCtxt > ) ) {
102
102
// NB: This visitor function just adds the pat ids into the id
103
103
// range. We gather loans that occur in patterns using the
104
104
// `gather_pat()` method below. Eventually these two should be
105
105
// brought together.
106
106
this. id_range . add ( p. id ) ;
107
- visit:: visit_pat ( p, this, v) ;
107
+ visit:: visit_pat ( p, ( this, v) ) ;
108
108
}
109
109
110
110
fn gather_loans_in_fn ( fk : & visit:: fn_kind ,
111
111
decl : & ast:: fn_decl ,
112
112
body : & ast:: blk ,
113
113
sp : span ,
114
114
id : ast:: node_id ,
115
- this : @mut GatherLoanCtxt ,
116
- v : visit:: vt < @mut GatherLoanCtxt > ) {
115
+ ( this, v ) : ( @mut GatherLoanCtxt ,
116
+ visit:: vt < @mut GatherLoanCtxt > ) ) {
117
117
match fk {
118
118
// Do not visit items here, the outer loop in borrowck/mod
119
119
// will visit them for us in turn.
@@ -124,22 +124,22 @@ fn gather_loans_in_fn(fk: &visit::fn_kind,
124
124
// Visit closures as part of the containing item.
125
125
& visit:: fk_anon( * ) | & visit:: fk_fn_block( * ) => {
126
126
this. push_repeating_id ( body. node . id ) ;
127
- visit:: visit_fn ( fk, decl, body, sp, id, this, v) ;
127
+ visit:: visit_fn ( fk, decl, body, sp, id, ( this, v) ) ;
128
128
this. pop_repeating_id ( body. node . id ) ;
129
129
}
130
130
}
131
131
}
132
132
133
133
fn gather_loans_in_block ( blk : & ast:: blk ,
134
- this : @mut GatherLoanCtxt ,
135
- vt : visit:: vt < @mut GatherLoanCtxt > ) {
134
+ ( this, vt ) : ( @mut GatherLoanCtxt ,
135
+ visit:: vt < @mut GatherLoanCtxt > ) ) {
136
136
this. id_range . add ( blk. node . id ) ;
137
- visit:: visit_block ( blk, this, vt) ;
137
+ visit:: visit_block ( blk, ( this, vt) ) ;
138
138
}
139
139
140
140
fn gather_loans_in_local ( local : @ast:: local ,
141
- this : @mut GatherLoanCtxt ,
142
- vt : visit:: vt < @mut GatherLoanCtxt > ) {
141
+ ( this, vt ) : ( @mut GatherLoanCtxt ,
142
+ visit:: vt < @mut GatherLoanCtxt > ) ) {
143
143
if local. node . init . is_none ( ) {
144
144
// Variable declarations without initializers are considered "moves":
145
145
let tcx = this. bccx . tcx ;
@@ -163,12 +163,12 @@ fn gather_loans_in_local(local: @ast::local,
163
163
}
164
164
}
165
165
166
- visit:: visit_local ( local, this, vt) ;
166
+ visit:: visit_local ( local, ( this, vt) ) ;
167
167
}
168
168
169
169
fn gather_loans_in_expr( ex : @ast:: expr ,
170
- this : @mut GatherLoanCtxt ,
171
- vt : visit:: vt < @mut GatherLoanCtxt > ) {
170
+ ( this, vt ) : ( @mut GatherLoanCtxt ,
171
+ visit:: vt < @mut GatherLoanCtxt > ) ) {
172
172
let bccx = this. bccx ;
173
173
let tcx = bccx. tcx ;
174
174
@@ -208,7 +208,7 @@ fn gather_loans_in_expr(ex: @ast::expr,
208
208
// for the lifetime `scope_r` of the resulting ptr:
209
209
let scope_r = ty_region ( tcx, ex. span , ty:: expr_ty ( tcx, ex) ) ;
210
210
this. guarantee_valid ( ex. id , ex. span , base_cmt, mutbl, scope_r) ;
211
- visit:: visit_expr ( ex, this, vt) ;
211
+ visit:: visit_expr ( ex, ( this, vt) ) ;
212
212
}
213
213
214
214
ast:: expr_assign( l, _) | ast:: expr_assign_op( _, _, l, _) => {
@@ -225,7 +225,7 @@ fn gather_loans_in_expr(ex: @ast::expr,
225
225
// with moves etc, just ignore.
226
226
}
227
227
}
228
- visit:: visit_expr ( ex, this, vt) ;
228
+ visit:: visit_expr ( ex, ( this, vt) ) ;
229
229
}
230
230
231
231
ast:: expr_match( ex_v, ref arms) => {
@@ -235,7 +235,7 @@ fn gather_loans_in_expr(ex: @ast::expr,
235
235
this. gather_pat ( cmt, * pat, arm. body . node . id , ex. id ) ;
236
236
}
237
237
}
238
- visit:: visit_expr( ex, this, vt) ;
238
+ visit:: visit_expr( ex, ( this, vt) ) ;
239
239
}
240
240
241
241
ast:: expr_index( _, _, arg) |
@@ -249,36 +249,36 @@ fn gather_loans_in_expr(ex: @ast::expr,
249
249
let scope_r = ty:: re_scope ( ex. id ) ;
250
250
let arg_cmt = this. bccx . cat_expr ( arg) ;
251
251
this. guarantee_valid ( arg. id , arg. span , arg_cmt, m_imm, scope_r) ;
252
- visit:: visit_expr ( ex, this, vt) ;
252
+ visit:: visit_expr ( ex, ( this, vt) ) ;
253
253
}
254
254
255
255
// see explanation attached to the `root_ub` field:
256
256
ast:: expr_while( cond, ref body) => {
257
257
// during the condition, can only root for the condition
258
258
this. push_repeating_id ( cond. id ) ;
259
- ( vt. visit_expr ) ( cond, this, vt) ;
259
+ ( vt. visit_expr ) ( cond, ( this, vt) ) ;
260
260
this. pop_repeating_id ( cond. id ) ;
261
261
262
262
// during body, can only root for the body
263
263
this. push_repeating_id ( body. node . id ) ;
264
- ( vt. visit_block ) ( body, this, vt) ;
264
+ ( vt. visit_block ) ( body, ( this, vt) ) ;
265
265
this. pop_repeating_id ( body. node . id ) ;
266
266
}
267
267
268
268
// see explanation attached to the `root_ub` field:
269
269
ast:: expr_loop( ref body, _) => {
270
270
this. push_repeating_id ( body. node . id ) ;
271
- visit:: visit_expr ( ex, this, vt) ;
271
+ visit:: visit_expr ( ex, ( this, vt) ) ;
272
272
this. pop_repeating_id ( body. node . id ) ;
273
273
}
274
274
275
275
ast:: expr_fn_block( * ) => {
276
276
gather_moves:: gather_captures ( this. bccx , this. move_data , ex) ;
277
- visit:: visit_expr ( ex, this, vt) ;
277
+ visit:: visit_expr ( ex, ( this, vt) ) ;
278
278
}
279
279
280
280
_ => {
281
- visit:: visit_expr ( ex, this, vt) ;
281
+ visit:: visit_expr ( ex, ( this, vt) ) ;
282
282
}
283
283
}
284
284
}
@@ -702,13 +702,13 @@ impl GatherLoanCtxt {
702
702
// Setting up info that preserve needs.
703
703
// This is just the most convenient place to do it.
704
704
fn add_stmt_to_map ( stmt : @ast:: stmt ,
705
- this : @mut GatherLoanCtxt ,
706
- vt : visit:: vt < @mut GatherLoanCtxt > ) {
705
+ ( this, vt ) : ( @mut GatherLoanCtxt ,
706
+ visit:: vt < @mut GatherLoanCtxt > ) ) {
707
707
match stmt. node {
708
708
ast:: stmt_expr( _, id) | ast:: stmt_semi( _, id) => {
709
709
this. bccx . stmt_map . insert ( id) ;
710
710
}
711
711
_ => ( )
712
712
}
713
- visit:: visit_stmt ( stmt, this, vt) ;
713
+ visit:: visit_stmt ( stmt, ( this, vt) ) ;
714
714
}
0 commit comments