Skip to content

False negative: std::panic::panic_any does not trigger verification error #1541

@chisa22

Description

@chisa22

Prusti correctly detects reachable panics when using the panic!() macro. However, when replacing it with std::panic::panic_any(()), Prusti fails to report a verification error even if they are semantically equivalent.
Reproduction

fn test_macro(x: bool) {
    panic!(); // Prusti correctly reports: "panic!(..) statement might be reachable"
}

fn test_panic_any(x: bool) {
    std::panic::panic_any(()); // Prusti reports NO errors (False Negative)
}

fn main() {}

Expected Behavior
Prusti should report a verification error for test_panic_any, indicating that a panic statement might be reachable, similar to how it handles test_macro.
Actual Behavior
Prusti verifies test_panic_any successfully without reporting any errors.

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