Skip to content

kani::modifies causes an error that compiler_builtins cannot call functions through upstream monomorphizations #477

@zjp-CN

Description

@zjp-CN

When I run dv on current verify-rust-std@ca49535, I got a compilation error as follows.
When I comment out kani::modifies just in this place, all crates compile fine. (NOTE there are some other modifies clauses around, and they don't bring any error except this annotation.)

error: `compiler_builtins` cannot call functions through upstream monomorphizations; 
encountered invalid call from `core::ops::index_range::IndexRange::next_unchecked` to `core::ops::index_range::IndexRange::next_unchecked::kani_contract_mode`
   --> /home/gh-zjp-CN/distributed-verification/verify-rust-std/library/core/src/ops/index_range.rs:63:5
    |
 63 |     #[cfg_attr(kani, kani::modifies(self))]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this attribute macro expansion
    |
   ::: /home/gh-zjp-CN/distributed-verification/kani/library/kani_macros/src/lib.rs:427:1
    |
427 | pub fn modifies(attr: TokenStream, item: TokenStream) -> TokenStream {
    | -------------------------------------------------------------------- in this expansion of `#[kani::modifies]`

Mentioned src localtions:

Also commented in

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