Skip to content

Commit

Permalink
Deal with another case where an expression preceding a function body was
Browse files Browse the repository at this point in the history
misinterpretted as a struct
  • Loading branch information
parno committed Dec 24, 2023
1 parent 7c3cd0b commit d264a92
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
6 changes: 5 additions & 1 deletion examples/wip.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
verus! {

exec static THREAD_COUNT: core::sync::atomic::AtomicUsize = core::sync::atomic::AtomicUsize::new(0);
fn count_size_overflow()
ensures !x.1 ==> x.0 == count * size
{
true
}

} // verus!
2 changes: 1 addition & 1 deletion src/verus.pest
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ fn_block_expr = {
}

prefix_expr = {
attr* ~ (dash_str | bang_str | star_str | triple_or | triple_and) ~ expr
attr* ~ (dash_str | bang_str | star_str | triple_or | triple_and) ~ expr_no_struct
}

assignment_ops = {
Expand Down
13 changes: 13 additions & 0 deletions tests/verus-consistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ pub fn test_function(x: bool, y: bool) -> u32
5
}
fn count_size_overflow()
ensures !x.1 ==> x.0 == count * size
{
true
}
spec fn dec0(a: int) -> int
decreases a,
when a
Expand Down Expand Up @@ -140,6 +146,13 @@ ensures res.is_Ok() ==> (res.get_Ok_0().1)@@.results_in(((), *mut_state))
5
}
fn count_size_overflow()
ensures
!x.1 ==> x.0 == count * size,
{
true
}
spec fn dec0(a: int) -> int
decreases a,
when a
Expand Down

0 comments on commit d264a92

Please sign in to comment.