prusti-dev icon indicating copy to clipboard operation
prusti-dev copied to clipboard

Failing procedural macro of a contract

Open fpoli opened this issue 1 year ago • 0 comments

The program

use prusti_contracts::*;

#[pure] // <-- ERROR
#[ensures="result > 0"]
fn len(r: i32) -> i32 {
  123
}

fails with

custom attribute panicked
message: internal error: entered unreachable code

However, the correct behaviour is to point out that the postcondition should be #[ensures(...)] instead of #[ensures="..."].

fpoli avatar Dec 08 '23 08:12 fpoli