You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following program Prusti identifies a verification error as expected: the method implementation A::bar does not specify a postcondition, so it gets by default the result > 10 from the trait definition, but the implementation returns 0. The error message currently points to the failing postcondition in the trait definition, but this is ambiguous because there are multiple types that implement that trait, and it's not immediately clear which of them is involved in the error.
The error message should use as primary span the fn baz() -> usize in the method implementation, excluding the method's body { .. } to keep the span short and readable.
externcrate prusti_contracts;traitFoo{#[ensures="result > 10"]// Failing postcondition. The verification error is currently reported here.fnbar() -> usize;}structA;implFooforA{fnbar() -> usize{// Bad implementation. The verification error should be reported here.0}}structB;implFooforB{fnbar() -> usize{// Correct implementation100}}fnmain(){}
The text was updated successfully, but these errors were encountered:
use prusti_contracts::*;traitFoo{#[ensures(result > 10)]// Failing postcondition. The verification error is currently reported here.fnbar() -> usize;}structA;implFooforA{fnbar() -> usize{// Bad implementation. The verification error should be reported here.0}}structB;implFooforB{fnbar() -> usize{// Correct implementation100}}fnmain(){}
In the following program Prusti identifies a verification error as expected: the method implementation
A::bar
does not specify a postcondition, so it gets by default theresult > 10
from the trait definition, but the implementation returns0
. The error message currently points to the failing postcondition in the trait definition, but this is ambiguous because there are multiple types that implement that trait, and it's not immediately clear which of them is involved in the error.The error message should use as primary span the
fn baz() -> usize
in the method implementation, excluding the method's body{ .. }
to keep the span short and readable.The text was updated successfully, but these errors were encountered: