Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shallow Borrows not supported #1388

Open
Patrick-6 opened this issue Apr 5, 2023 · 0 comments
Open

Shallow Borrows not supported #1388

Patrick-6 opened this issue Apr 5, 2023 · 0 comments

Comments

@Patrick-6
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant