@@ -61,12 +61,10 @@ impl Clone for LoanDataFlowOperator {
6161
6262pub type LoanDataFlow = DataFlowContext < LoanDataFlowOperator > ;
6363
64- struct BorrowckVisitor ;
65-
66- impl Visitor < @BorrowckCtxt > for BorrowckVisitor {
64+ impl Visitor < ( ) > for BorrowckCtxt {
6765 fn visit_fn ( & mut self , fk : & fn_kind , fd : & fn_decl ,
68- b : & Block , s : Span , n : NodeId , e : @ BorrowckCtxt ) {
69- borrowck_fn ( self , fk, fd, b, s, n, e ) ;
66+ b : & Block , s : Span , n : NodeId , _ : ( ) ) {
67+ borrowck_fn ( self , fk, fd, b, s, n) ;
7068 }
7169}
7270
@@ -78,7 +76,7 @@ pub fn check_crate(
7876 capture_map : moves:: CaptureMap ,
7977 crate : & ast:: Crate ) -> ( root_map , write_guard_map )
8078{
81- let bccx = @ BorrowckCtxt {
79+ let mut bccx = BorrowckCtxt {
8280 tcx : tcx,
8381 method_map : method_map,
8482 moves_map : moves_map,
@@ -96,9 +94,9 @@ pub fn check_crate(
9694 guaranteed_paths : 0 ,
9795 }
9896 } ;
97+ let bccx = & mut bccx;
9998
100- let mut v = BorrowckVisitor ;
101- visit:: walk_crate ( & mut v, crate , bccx) ;
99+ visit:: walk_crate ( bccx, crate , ( ) ) ;
102100
103101 if tcx. sess . borrowck_stats ( ) {
104102 io:: println ( "--- borrowck stats ---" ) ;
@@ -116,20 +114,19 @@ pub fn check_crate(
116114
117115 return ( bccx. root_map , bccx. write_guard_map ) ;
118116
119- fn make_stat ( bccx : & BorrowckCtxt , stat : uint ) -> ~str {
117+ fn make_stat ( bccx : & mut BorrowckCtxt , stat : uint ) -> ~str {
120118 let stat_f = stat as float ;
121119 let total = bccx. stats . guaranteed_paths as float ;
122120 fmt ! ( "%u (%.0f%%)" , stat , stat_f * 100 f / total)
123121 }
124122}
125123
126- fn borrowck_fn ( v : & mut BorrowckVisitor ,
124+ fn borrowck_fn ( this : & mut BorrowckCtxt ,
127125 fk : & visit:: fn_kind ,
128126 decl : & ast:: fn_decl ,
129127 body : & ast:: Block ,
130128 sp : Span ,
131- id : ast:: NodeId ,
132- this : @BorrowckCtxt ) {
129+ id : ast:: NodeId ) {
133130 match fk {
134131 & visit:: fk_anon( * ) |
135132 & visit:: fk_fn_block( * ) => {
@@ -166,7 +163,7 @@ fn borrowck_fn(v: &mut BorrowckVisitor,
166163 }
167164 }
168165
169- visit:: walk_fn ( v , fk, decl, body, sp, id, this ) ;
166+ visit:: walk_fn ( this , fk, decl, body, sp, id, ( ) ) ;
170167}
171168
172169// ----------------------------------------------------------------------
0 commit comments