Skip to content

Commit

Permalink
Collect some example code that we produce and Verus dislikes
Browse files Browse the repository at this point in the history
  • Loading branch information
parno committed Dec 11, 2023
1 parent 265e5bc commit 1900d70
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion examples/wip.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
verus! {

// We add a trailing comma that Verus (and Rust) doesn't like
spec fn host_ignoring_unparseable(pre: AbstractHostState, post: AbstractHostState) -> bool {
post == AbstractHostState { received_packet: None, ..pre }
post == AbstractHostState { received_packet: None, another_long_field_name: 12345, yet_another_long_field_name: 12345, ..pre }
}

// We add a comma after the ensures, which Verus doesn't like
fn is_marshalable() -> (res: bool)
ensures res == self.is_marshalable();

fn test() {
// Adds a comma that `reveal` doesn't like
reveal(crate::marshal_ironsht_specific_v::ckeyhashmap_max_serialized_size);
}

// We add an extra star in front of the const
#[verifier(external)]
pub unsafe fn unflatten_args(
num_args: i32,
arg_lengths: *const i32,
) -> bool
{
true
}


} // verus!

0 comments on commit 1900d70

Please sign in to comment.