diff options
| author | Graydon Hoare <[email protected]> | 2011-04-19 13:35:49 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-04-19 13:35:49 -0700 |
| commit | d2bd07dcb02783063375b6c8532fceaf9fa9d50f (patch) | |
| tree | a253b5eadb140d14bc99d1456e316ce1e210a6be /src/comp/util | |
| parent | rustc: Allow glue to be emitted even for scalar types; this is necessary to s... (diff) | |
| download | rust-d2bd07dcb02783063375b6c8532fceaf9fa9d50f.tar.xz rust-d2bd07dcb02783063375b6c8532fceaf9fa9d50f.zip | |
Remove effect system from src.
Diffstat (limited to 'src/comp/util')
| -rw-r--r-- | src/comp/util/typestate_ann.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/comp/util/typestate_ann.rs b/src/comp/util/typestate_ann.rs index 9ccb8731..b1f12ffb 100644 --- a/src/comp/util/typestate_ann.rs +++ b/src/comp/util/typestate_ann.rs @@ -85,20 +85,20 @@ fn pps_len(&pre_and_post p) -> uint { ret p.precondition.nbits; } -impure fn require_and_preserve(uint i, &pre_and_post p) -> () { +fn require_and_preserve(uint i, &pre_and_post p) -> () { // sets the ith bit in p's pre and post bitv.set(p.precondition, i, true); bitv.set(p.postcondition, i, true); } -impure fn set_in_postcond(uint i, &pre_and_post p) -> bool { +fn set_in_postcond(uint i, &pre_and_post p) -> bool { // sets the ith bit in p's post auto was_set = bitv.get(p.postcondition, i); bitv.set(p.postcondition, i, true); ret !was_set; } -impure fn set_in_poststate(uint i, &pre_and_post_state s) -> bool { +fn set_in_poststate(uint i, &pre_and_post_state s) -> bool { // sets the ith bit in p's post auto was_set = bitv.get(s.poststate, i); bitv.set(s.poststate, i, true); @@ -107,35 +107,35 @@ impure fn set_in_poststate(uint i, &pre_and_post_state s) -> bool { // Sets all the bits in a's precondition to equal the // corresponding bit in p's precondition. -impure fn set_precondition(&ts_ann a, &precond p) -> () { +fn set_precondition(&ts_ann a, &precond p) -> () { bitv.copy(a.conditions.precondition, p); } // Sets all the bits in a's postcondition to equal the // corresponding bit in p's postcondition. -impure fn set_postcondition(&ts_ann a, &postcond p) -> () { +fn set_postcondition(&ts_ann a, &postcond p) -> () { bitv.copy(a.conditions.postcondition, p); } // Sets all the bits in a's prestate to equal the // corresponding bit in p's prestate. -impure fn set_prestate(&ts_ann a, &prestate p) -> bool { +fn set_prestate(&ts_ann a, &prestate p) -> bool { ret bitv.copy(a.states.prestate, p); } // Sets all the bits in a's postcondition to equal the // corresponding bit in p's postcondition. -impure fn set_poststate(&ts_ann a, &poststate p) -> bool { +fn set_poststate(&ts_ann a, &poststate p) -> bool { ret bitv.copy(a.states.poststate, p); } // Set all the bits in p that are set in new -impure fn extend_prestate(&prestate p, &poststate new) -> bool { +fn extend_prestate(&prestate p, &poststate new) -> bool { ret bitv.union(p, new); } // Set all the bits in p that are set in new -impure fn extend_poststate(&poststate p, &poststate new) -> bool { +fn extend_poststate(&poststate p, &poststate new) -> bool { ret bitv.union(p, new); } @@ -150,7 +150,7 @@ fn ann_prestate(&ts_ann a) -> prestate { // returns true if a implies b // that is, returns true except if for some bits c and d, // c = 1 and d = 0 -impure fn implies(bitv.t a, bitv.t b) -> bool { +fn implies(bitv.t a, bitv.t b) -> bool { auto tmp = bitv.clone(b); bitv.difference(tmp, a); ret bitv.is_false(tmp); |