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/sha1.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/sha1.rs')
| -rw-r--r-- | src/lib/sha1.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/sha1.rs b/src/lib/sha1.rs index 3866be1e..690489db 100644 --- a/src/lib/sha1.rs +++ b/src/lib/sha1.rs @@ -43,7 +43,7 @@ fn mk_sha1() -> sha1 { fn add_input(&sha1state st, &vec[u8] msg) { // FIXME: Should be typestate precondition - check (!st.computed); + assert (!st.computed); for (u8 element in msg) { st.msg_block.(st.msg_block_idx) = element; @@ -67,7 +67,7 @@ fn mk_sha1() -> sha1 { fn process_msg_block(&sha1state st) { // FIXME: Make precondition - check (_vec.len[mutable u32](st.h) == digest_buf_len); + assert (_vec.len[mutable u32](st.h) == digest_buf_len); // Constants auto k = vec(0x5A827999u32, @@ -192,7 +192,7 @@ fn mk_sha1() -> sha1 { */ fn pad_msg(&sha1state st) { // FIXME: Should be a precondition - check (_vec.len[mutable u8](st.msg_block) == msg_block_len); + assert (_vec.len[mutable u8](st.msg_block) == msg_block_len); /* * Check to see if the current message block is too small to hold @@ -236,7 +236,7 @@ fn mk_sha1() -> sha1 { fn reset() { // FIXME: Should be typestate precondition - check (_vec.len[mutable u32](st.h) == digest_buf_len); + assert (_vec.len[mutable u32](st.h) == digest_buf_len); st.len_low = 0u32; st.len_high = 0u32; |