prusti-dev
prusti-dev copied to clipboard
Shallow Borrows not supported
Shallow borrows are not yet supported by Prusti. These appear when verifying code containing match guards on references:
use prusti_contracts::*;
struct Wrapper { x: i32 }
fn test(t: &Wrapper) {
match t {
Wrapper{ x } if x % 2 == 0 => {},
Wrapper{ x } => {}
}
}
Error:
[Prusti: unsupported feature]
unsupported creation of shallow borrows (implicitly created when lowering matches)
This limitation is also mentioned in #543 in the test tests_old/verify/fail/simple-specs/order-of-branches.rs.