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 }