@@ -62,7 +62,7 @@ import bitvectors::promises;
62
62
63
63
import annotate:: annotate_crate;
64
64
import collect_locals:: mk_f_to_fn_info;
65
- import pre_post_conditions:: check_item_fn ;
65
+ import pre_post_conditions:: fn_pre_post ;
66
66
import states:: find_pre_post_state_fn;
67
67
68
68
fn check_states_expr ( & fn_ctxt fcx, @expr e ) -> ( ) {
@@ -199,19 +199,18 @@ fn check_crate(ty::node_type_table nt, ty::ctxt cx, @crate crate) -> @crate {
199
199
annotate_crate ( ccx, * crate ) ;
200
200
201
201
/* Compute the pre and postcondition for every subexpression */
202
-
203
- auto fld = new_identity_fold[ crate_ctxt] ( ) ;
204
- fld = @rec ( fold_item_fn = bind check_item_fn ( _, _, _, _, _, _, _) with * fld) ;
205
- auto with_pre_postconditions =
206
- fold_crate[ crate_ctxt] ( ccx, fld, crate ) ;
202
+ auto do_pre_post = walk:: default_visitor ( ) ;
203
+ do_pre_post = rec ( visit_fn_pre = bind fn_pre_post ( ccx, _, _, _)
204
+ with do_pre_post) ;
205
+ walk:: walk_crate ( do_pre_post, * crate ) ;
207
206
208
207
auto fld1 = new_identity_fold[ crate_ctxt] ( ) ;
209
208
210
209
fld1 = @rec ( fold_item_fn = bind check_item_fn_state ( _, _, _, _, _, _, _) ,
211
210
fold_obj = bind check_obj_state ( _, _, _, _)
212
211
with * fld1) ;
213
212
214
- ret fold_crate[ crate_ctxt] ( ccx, fld1, with_pre_postconditions ) ;
213
+ ret fold_crate[ crate_ctxt] ( ccx, fld1, crate ) ;
215
214
}
216
215
217
216
//
0 commit comments