Skip to content

Combine proof annotation with attributes #1217

Description

@zhassan-aws

Requested feature: Currently, harnesses need to be annotated with #[kani::proof], and with #[kani::unwind(n)] if the harness requires an unwinding. Would be nice if those two can be combined, e.g.:

#[kani::proof(unwind = 8)]

Activity

  1. tedinski commented on May 24, 2022

    @tedinski
    Contributor

    iirc, we explicitly decided against this, I don't remember why though

  2. camshaft commented on May 24, 2022

    @camshaft
    Contributor

    combining the attributes would make it a bit cleaner when using cfg_attr:

    #[cfg_attr(kani, kani::proof(unwind = 8))]

    vs

    #[cfg_attr(kani, kani::proof)]
    #[cfg_attr(kani, kani::unwind(8))]
  3. zhassan-aws commented on May 24, 2022

    @zhassan-aws
    ContributorAuthor

    According to https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute, it should be possible to combine them into one cfg_attr

         #[cfg_attr(kani, kani::proof, kani::unwind(5))]
    

    ?

  4. camshaft commented on May 24, 2022

    @camshaft
    Contributor

    oh nice. i didn't know you could do that!

  5. self-assigned this
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[C] Feature / EnhancementA new feature request or enhancement to an existing feature.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions