diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-06-07 16:29:41 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-06-07 16:29:41 -0700 |
| commit | 8c6d439a8165c3bfe3561fac1234091618f58938 (patch) | |
| tree | aac2ba39eeebeaeb53a7ecd84bc2d25950d2a14a /src/rustc | |
| parent | 64b5ae27accc1e7b095287034bbd9727850b42de (diff) | |
| download | rust-8c6d439a8165c3bfe3561fac1234091618f58938.tar.gz rust-8c6d439a8165c3bfe3561fac1234091618f58938.zip | |
Comments only: annotate remainder of FIXMEs in typestate
Diffstat (limited to 'src/rustc')
| -rw-r--r-- | src/rustc/middle/tstate/states.rs | 6 | ||||
| -rw-r--r-- | src/rustc/middle/tstate/tritv.rs | 11 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/rustc/middle/tstate/states.rs b/src/rustc/middle/tstate/states.rs index eaf4be1955c..c5a4e1c5815 100644 --- a/src/rustc/middle/tstate/states.rs +++ b/src/rustc/middle/tstate/states.rs @@ -168,7 +168,9 @@ fn find_pre_post_state_call(fcx: fn_ctxt, pres: prestate, a: @expr, id: node_id, ops: [init_op], bs: [@expr], cf: ret_style) -> bool { let mut changed = find_pre_post_state_expr(fcx, pres, a); - // FIXME: This could be a typestate constraint + // FIXME: This could be a typestate constraint (except we're + // not using them inside the compiler, I guess... see + // discussion at #2178) if vec::len(bs) != vec::len(ops) { fcx.ccx.tcx.sess.span_bug(a.span, #fmt["mismatched arg lengths: \ @@ -511,8 +513,6 @@ fn find_pre_post_state_expr(fcx: fn_ctxt, pres: prestate, e: @expr) -> bool { ret find_pre_post_state_sub(fcx, pres, x, e.id, none); } expr_fail(maybe_fail_val) { - // FIXME Should factor out this code, - // which also appears in find_pre_post_state_exprs /* if execution continues after fail, then everything is true! woo! */ let post = false_postcond(num_constrs); diff --git a/src/rustc/middle/tstate/tritv.rs b/src/rustc/middle/tstate/tritv.rs index 05fcbca9633..546a8ae7deb 100644 --- a/src/rustc/middle/tstate/tritv.rs +++ b/src/rustc/middle/tstate/tritv.rs @@ -27,6 +27,8 @@ export to_str; 11 should never appear FIXME: typestate precondition (uncertain and val must have the same length; 11 should never appear in a given position) + (except we're not putting typestate constraints in the compiler, as + per discussion at #2178). */ type t = {uncertain: bitv::bitv, val: bitv::bitv, nbits: uint}; @@ -88,11 +90,9 @@ fn trit_or(a: trit, b: trit) -> trit { tfalse { alt b { ttrue { dont_care } - - - - - /* FIXME: ?????? */ + /* FIXME: ?????? + Again, unit tests would help here -- #2538 + */ _ { tfalse } @@ -106,6 +106,7 @@ fn trit_or(a: trit, b: trit) -> trit { // all variables start out in a 0 state. Probably I need // to make it so that all constraints start out in a 0 state // (we consider a constraint false until proven true), too. +// #2538 would help. fn trit_and(a: trit, b: trit) -> trit { alt a { dont_care { b } |
