Skip to content

Commit 8c6d439

Browse files
committed
Comments only: annotate remainder of FIXMEs in typestate
1 parent 64b5ae2 commit 8c6d439

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/rustc/middle/tstate/states.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ fn find_pre_post_state_call(fcx: fn_ctxt, pres: prestate, a: @expr,
168168
id: node_id, ops: [init_op], bs: [@expr],
169169
cf: ret_style) -> bool {
170170
let mut changed = find_pre_post_state_expr(fcx, pres, a);
171-
// FIXME: This could be a typestate constraint
171+
// FIXME: This could be a typestate constraint (except we're
172+
// not using them inside the compiler, I guess... see
173+
// discussion at #2178)
172174
if vec::len(bs) != vec::len(ops) {
173175
fcx.ccx.tcx.sess.span_bug(a.span,
174176
#fmt["mismatched arg lengths: \
@@ -511,8 +513,6 @@ fn find_pre_post_state_expr(fcx: fn_ctxt, pres: prestate, e: @expr) -> bool {
511513
ret find_pre_post_state_sub(fcx, pres, x, e.id, none);
512514
}
513515
expr_fail(maybe_fail_val) {
514-
// FIXME Should factor out this code,
515-
// which also appears in find_pre_post_state_exprs
516516
/* if execution continues after fail, then everything is true!
517517
woo! */
518518
let post = false_postcond(num_constrs);

src/rustc/middle/tstate/tritv.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export to_str;
2727
11 should never appear
2828
FIXME: typestate precondition (uncertain and val must
2929
have the same length; 11 should never appear in a given position)
30+
(except we're not putting typestate constraints in the compiler, as
31+
per discussion at #2178).
3032
*/
3133

3234
type t = {uncertain: bitv::bitv, val: bitv::bitv, nbits: uint};
@@ -88,11 +90,9 @@ fn trit_or(a: trit, b: trit) -> trit {
8890
tfalse {
8991
alt b {
9092
ttrue { dont_care }
91-
92-
93-
94-
95-
/* FIXME: ?????? */
93+
/* FIXME: ??????
94+
Again, unit tests would help here -- #2538
95+
*/
9696
_ {
9797
tfalse
9898
}
@@ -106,6 +106,7 @@ fn trit_or(a: trit, b: trit) -> trit {
106106
// all variables start out in a 0 state. Probably I need
107107
// to make it so that all constraints start out in a 0 state
108108
// (we consider a constraint false until proven true), too.
109+
// #2538 would help.
109110
fn trit_and(a: trit, b: trit) -> trit {
110111
alt a {
111112
dont_care { b }

0 commit comments

Comments
 (0)