Skip to content

cargo verus passes arguments like --verify-module to dependencies too #1938

@jaybosamiya-ms

Description

@jaybosamiya-ms

cargo verus's implementation seems to pass along the parameters after the -- to all dependencies (including vstd), so something like cargo verus verify -- --verify-module bar for the following files will fail on the vstd build.

Cargo.toml

[package]
name = "foo"
version = "0.1.0"
edition = "2021"
[dependencies]
vstd = "=0.0.0-2025-08-12-1837"
[package.metadata.verus]
verify = true

src/lib.rs

use vstd::prelude::*;

verus! {

mod bar {
    use vstd::prelude::*;

    fn baz() {
        assert(1 == 0 + 1);
    }

}

} // verus!

The workaround for this is fairly straightforward, just run cargo verus verify first (so that vstd finishes; although you'll have to delete target/ first to clear out the cache), followed by cargo verus verify -- --verify-module bar, which then works as expected.

However, this workaround works fine only for single-crate situations. If we are in a multi-crate workspace (e.g., https://github.com/verus-lang/verus-mode.el/tree/main/verus-examples/cv-workspace), then the there is no way to restrict the --verify-module to just a single one of the crates in the workspace. Thus, we cannot benefit from partial verification which can be a performance bottleneck especially when working on a file (you can prob see why I hit this issue when adding support for cargo verus on workspaces within verus-mode.el).

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