The following code, divided into a Cargo.toml and two .rs files, verifies with cargo verus verify. However, if you then comment out the assume_specification in the second file, and rerun cargo verus verify, the output indicates no error. Verus should realize that main.rs is dependent on that change, and try to re-verify it (and fail). But you have to do cargo clean to see the error.
Cargo.toml:
[package]
name = "test1"
version = "0.1.0"
edition = "2024"
[package.metadata.verus]
verify = true
[dependencies]
vstd = { version = "=0.0.0-2026-08-09-0044" }
num-bigint = { version = "0.5", default-features = false }
src/main.rs:
use vstd::prelude::*;
use num_bigint::BigInt;
mod b;
use crate::b::*;
verus! {
pub fn convert_integer(i: i16)
{
let m = BigInt::from(i);
assert(m@ == i);
}
}
fn main() {
convert_integer(3i16);
println!("Hello, world!");
}
src/b.rs:
use vstd::prelude::*;
use num_bigint::BigInt;
verus! {
#[verifier::external_type_specification]
#[verifier::external_body]
pub struct ExNumBigInt(num_bigint::BigInt);
pub trait BigIntAdditionalSpecFns {
spec fn view(&self) -> int;
}
impl BigIntAdditionalSpecFns for BigInt {
uninterp spec fn view(&self) -> int;
}
pub assume_specification[ <BigInt as core::convert::From<i16>>::from ](i: i16) -> (res: BigInt)
ensures
res@ == i,
;
}
The following code, divided into a
Cargo.tomland two.rsfiles, verifies withcargo verus verify. However, if you then comment out theassume_specificationin the second file, and reruncargo verus verify, the output indicates no error. Verus should realize thatmain.rsis dependent on that change, and try to re-verify it (and fail). But you have to docargo cleanto see the error.Cargo.toml:
src/main.rs:
src/b.rs: