verus-lang / verus

Verified Rust for low-level systems code
MIT License
1.06k stars 58 forks source link

Explicit type required for tuple result of choose #1183

Closed jaylorch closed 4 days ago

jaylorch commented 1 week ago

In the docs (specifically, source/docs/guide/src/exists.md), it says:

TODO: `(x, y)` should not require the type annotation `: (int, int)`

for the following code:

spec fn less_than(x: int, y: int) -> bool {
    x < y
}

proof fn test_choose_succeeds2() {
    assert(less_than(3, 7));  // promote i = 3, i = 7 as a witness
    let (x, y): (int, int) = choose|i: int, j: int| less_than(i, j);
    assert(x < y);
}

We should fix that, and then remove the TODO from the docs.