Skip to content

Reachable assert panic by ensure in spec #2175

@Marsman1996

Description

@Marsman1996

PoC

use vstd::prelude::*;
verus! {
#[verus_spec(ensures true)]
pub const C: char = 'x';
fn main() {}
}

Panic Log

assert!(!function.x.has.has_ensures); // no ensures allowed on spec functions yet

thread '<unnamed>' (47) panicked at vir/src/sst_to_air_func.rs:701:9:
assertion failed: !function.x.has.has_ensures
note: [run with `RUST_BACKTRACE=1` environment variable to display a backtrace](https://play.verus-lang.org/?version=stable&mode=basic&edition=2021#)

thread '<unnamed>' (47) panicked at rust_verify/src/verifier.rs:2154:29:
worker thread panicked

Env

Verus Version: 2026.02.11 c780c07

Playground Link

https://play.verus-lang.org/?version=stable&mode=basic&edition=2021&gist=8b8331645f3a4f612f184756d5e118dc

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