Skip to content

[ICE] Prusti panics when verifying closures that capture environment variables. #1546

Description

@rikki322

Prusti consistently crashes with an Internal Compiler Error (ICE) when verifying any function containing a closure that captures variables from the enclosing scope (e.g., function arguments).
Reproduction

fn test(x: u64, y: u64) -> u64 {
    (|| {
    x / y 
})()
}
fn main() {
    test(1, 0);
}

Actual Behavior
The compiler panics with an internal error:

error: [Prusti: internal error] Prusti encountered an unexpected internal error
...
thread 'rustc' panicked at ...

Expected Behavior
Prusti should report a standard verification error, not crash.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions