Skip to content

Confusing coverage result: Uncovered end of block on if statement #3455

Description

@adpaco

We noticed a confusing coverage result in #3119 where, for the code

#[kani::proof]
fn main() {
    let x: u32 = kani::any_where(|val| *val == 5);
    if x > 3 {
        assert!(x > 4);
    }
}

we get the result

Source-based code coverage results:

test.rs (main)\
 * 5:1 - 6:34 COVERED\
 * 7:14 - 9:6 COVERED\
 * 9:6 - 9:7 UNCOVERED

test.rs (main::{closure#0})\
 * 6:40 - 6:49 COVERED

It's not clear to me why this is happening. It's also strange that no region is associated to if x > 3 here. Maybe it's due to an artifact introduced by the closure?

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

    Z-UnstableFeatureIssues that only occur if a unstable feature is enabled[C] BugThis is a bug. Something isn't working.[E] User ExperienceAn UX enhancement for an existing feature. Including deprecation of an existing one.[F] Spurious FailureIssues that cause Kani verification to fail despite the code being correct.

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions