@@ -32,7 +32,7 @@ use syntax::codemap::Span;
32
32
use syntax:: print:: pprust;
33
33
use syntax:: visit;
34
34
use syntax:: visit:: { Visitor , fn_kind} ;
35
- use syntax:: ast:: { Expr , fn_decl, Block , NodeId , Stmt , Pat , Local } ;
35
+ use syntax:: ast:: { P , Expr , fn_decl, Block , NodeId , Stmt , Pat , Local } ;
36
36
37
37
mod lifetime;
38
38
mod restrictions;
@@ -77,10 +77,10 @@ impl<'self> visit::Visitor<()> for GatherLoanCtxt<'self> {
77
77
fn visit_expr ( & mut self , ex : @Expr , _: ( ) ) {
78
78
gather_loans_in_expr ( self , ex) ;
79
79
}
80
- fn visit_block ( & mut self , b : & Block , _: ( ) ) {
80
+ fn visit_block ( & mut self , b : P < Block > , _: ( ) ) {
81
81
gather_loans_in_block ( self , b) ;
82
82
}
83
- fn visit_fn ( & mut self , fk : & fn_kind , fd : & fn_decl , b : & Block ,
83
+ fn visit_fn ( & mut self , fk : & fn_kind , fd : & fn_decl , b : P < Block > ,
84
84
s : Span , n : NodeId , _: ( ) ) {
85
85
gather_loans_in_fn ( self , fk, fd, b, s, n) ;
86
86
}
@@ -102,7 +102,7 @@ impl<'self> visit::Visitor<()> for GatherLoanCtxt<'self> {
102
102
103
103
pub fn gather_loans ( bccx : & BorrowckCtxt ,
104
104
decl : & ast:: fn_decl ,
105
- body : & ast:: Block )
105
+ body : ast:: P < ast :: Block > )
106
106
-> ( id_range , @mut ~[ Loan ] , @mut move_data:: MoveData ) {
107
107
let mut glcx = GatherLoanCtxt {
108
108
bccx : bccx,
@@ -131,7 +131,7 @@ fn add_pat_to_id_range(this: &mut GatherLoanCtxt,
131
131
fn gather_loans_in_fn ( this : & mut GatherLoanCtxt ,
132
132
fk : & fn_kind ,
133
133
decl : & ast:: fn_decl ,
134
- body : & ast:: Block ,
134
+ body : ast:: P < ast :: Block > ,
135
135
sp : Span ,
136
136
id : ast:: NodeId ) {
137
137
match fk {
@@ -150,7 +150,7 @@ fn gather_loans_in_fn(this: &mut GatherLoanCtxt,
150
150
}
151
151
152
152
fn gather_loans_in_block ( this : & mut GatherLoanCtxt ,
153
- blk : & ast:: Block ) {
153
+ blk : ast:: P < ast :: Block > ) {
154
154
this. id_range . add ( blk. id ) ;
155
155
visit:: walk_block ( this, blk, ( ) ) ;
156
156
}
@@ -286,7 +286,7 @@ fn gather_loans_in_expr(this: &mut GatherLoanCtxt,
286
286
}
287
287
288
288
// see explanation attached to the `root_ub` field:
289
- ast:: ExprWhile ( cond, ref body) => {
289
+ ast:: ExprWhile ( cond, body) => {
290
290
// during the condition, can only root for the condition
291
291
this. push_repeating_id ( cond. id ) ;
292
292
this. visit_expr ( cond, ( ) ) ;
@@ -299,7 +299,7 @@ fn gather_loans_in_expr(this: &mut GatherLoanCtxt,
299
299
}
300
300
301
301
// see explanation attached to the `root_ub` field:
302
- ast:: ExprLoop ( ref body, _) => {
302
+ ast:: ExprLoop ( body, _) => {
303
303
this. push_repeating_id ( body. id ) ;
304
304
visit:: walk_expr ( this, ex, ( ) ) ;
305
305
this. pop_repeating_id ( body. id ) ;
0 commit comments