diff options
| author | Tim Chevalier <[email protected]> | 2011-04-12 19:03:52 -0700 |
|---|---|---|
| committer | Tim Chevalier <[email protected]> | 2011-04-12 19:03:52 -0700 |
| commit | 63e87c102d7b57b697fe274c64b9c895113e9171 (patch) | |
| tree | b349625cabef2df8754b228b5126e7ade1c80788 /src/comp/middle/fold.rs | |
| parent | Finish the majority of statement -> expression rearrangement in manual. (diff) | |
| download | rust-63e87c102d7b57b697fe274c64b9c895113e9171.tar.xz rust-63e87c102d7b57b697fe274c64b9c895113e9171.zip | |
typestate_check can now handle expr_block, expr_if, and expr_binary
(caveat for the latter: it assumes that binary operations are strict;
a TODO is to detect or and and and correctly reflect that they're lazy
in the second argument). I had to add an ann field to ast.block,
resulting in the usual boilerplate changes.
Test cases that currently work (if you uncomment the typestate pass
in the driver) (all these are under test/compile-fail):
fru-typestate
ret-uninit
use-uninit
use-uninit-2
use-uninit-3
Diffstat (limited to 'src/comp/middle/fold.rs')
| -rw-r--r-- | src/comp/middle/fold.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/comp/middle/fold.rs b/src/comp/middle/fold.rs index e9c4ee2a..fbf43c55 100644 --- a/src/comp/middle/fold.rs +++ b/src/comp/middle/fold.rs @@ -871,7 +871,8 @@ fn fold_block[ENV](&ENV env, ast_fold[ENV] fld, &block blk) -> block { } } - ret respan(blk.span, rec(stmts=stmts, expr=expr, index=index)); + auto aa = fld.fold_ann(env, blk.node.a); + ret respan(blk.span, rec(stmts=stmts, expr=expr, index=index, a=aa)); } fn fold_arm[ENV](&ENV env, ast_fold[ENV] fld, &arm a) -> arm { |