diff options
| author | Tim Chevalier <[email protected]> | 2011-05-02 11:23:07 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-05-02 12:16:29 -0700 |
| commit | aa25f22f197682de3b18fc4c8ba068d1feda220f (patch) | |
| tree | 6d01f8fbb5680964fd9c53564c96aa58cb75d3d1 /src/lib/bitv.rs | |
| parent | rustc: Add a "fat tydesc" LLVM type to trans (diff) | |
| download | rust-aa25f22f197682de3b18fc4c8ba068d1feda220f.tar.xz rust-aa25f22f197682de3b18fc4c8ba068d1feda220f.zip | |
Use different syntax for checks that matter to typestate
This giant commit changes the syntax of Rust to use "assert" for
"check" expressions that didn't mean anything to the typestate
system, and continue using "check" for checks that are used as
part of typestate checking.
Most of the changes are just replacing "check" with "assert" in test
cases and rustc.
Diffstat (limited to 'src/lib/bitv.rs')
| -rw-r--r-- | src/lib/bitv.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/bitv.rs b/src/lib/bitv.rs index feb4296a..f52b016b 100644 --- a/src/lib/bitv.rs +++ b/src/lib/bitv.rs @@ -28,8 +28,8 @@ fn create(uint nbits, bool init) -> t { fn process(&fn(uint, uint) -> uint op, &t v0, &t v1) -> bool { auto len = _vec.len[mutable uint](v1.storage); - check (_vec.len[mutable uint](v0.storage) == len); - check (v0.nbits == v1.nbits); + assert (_vec.len[mutable uint](v0.storage) == len); + assert (v0.nbits == v1.nbits); auto changed = false; @@ -84,7 +84,7 @@ fn clone(t v) -> t { } fn get(&t v, uint i) -> bool { - check (i < v.nbits); + assert (i < v.nbits); auto bits = uint_bits(); @@ -129,7 +129,7 @@ fn difference(&t v0, &t v1) -> bool { } fn set(&t v, uint i, bool x) { - check (i < v.nbits); + assert (i < v.nbits); auto bits = uint_bits(); @@ -196,7 +196,7 @@ fn to_str(&t v) -> str { // FIXME: can we just use structural equality on to_vec? fn eq_vec(&t v0, &vec[uint] v1) -> bool { - check (v0.nbits == _vec.len[uint](v1)); + assert (v0.nbits == _vec.len[uint](v1)); auto len = v0.nbits; auto i = 0u; while (i < len) { |