Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hax-lib): allow requires & ensures on &mut inputs functions #764

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

W95Psp
Copy link
Collaborator

@W95Psp W95Psp commented Jul 10, 2024

Fixes #755 and fixes #290.

This allows this kind of post-conditions:

#[hax::requires(*x < 40 && *y < 300)]
#[hax::ensures(|result| *future(x) == *y && *future(y) == *x && result == *x + *y)]
fn swap_and_mut_req_ens(x: &mut u32, y: &mut u32) -> u32 {
    let x0 = *x;
    *x = *y;
    *y = x0;
    *x + *y
}

@W95Psp W95Psp added this pull request to the merge queue Jul 11, 2024
Merged via the queue into main with commit 717d606 Jul 11, 2024
13 checks passed
@W95Psp W95Psp deleted the mut-pre-post branch July 11, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
2 participants