verus-lang / verus

Verified Rust for low-level systems code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

--expand-errors broken in trait defaults

jonhnet opened this issue · comments

(low priority; expand errors is just a convenience to save manual diagnostic steps)

I had a case where --expand-errors looked at the empty trait spec fn instead of the impl in the current context. Manually expanding the (actually available) definition worked as expected. I tried minimizing the bug, but got a crash instead. Here's something like a test case:

use builtin::*;
use builtin_macros::*;

verus!{

spec fn p() -> bool { true }
spec fn q() -> bool { false }
spec fn r() -> bool { true }

trait A {
    spec fn x() -> bool
        ;

    proof fn x_true()
        ensures Self::x()
        ;
}

impl A for u64 {
    spec fn x() -> bool {
        &&& p()
        &&& q()
        &&& r()
    }

    proof fn x_true()
    {
    }
}

}

Looks like this was fixed in a07ea9c