Skip to content

Unable to run example after successful install #4574

@sftse

Description

@sftse

After successful install with no errors, according to the tutorial

cargo install --locked kani-verifier
cargo kani setup

kani lib.rs fails on this example code

// File: lib.rs
#[kani::proof]
fn main() {
    assert!(1 == 2);
}
Kani Rust Verifier 0.67.0 (standalone)
error[E0463]: can't find crate for `rustc_std_workspace_core` which `std` depends on
  |
  = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`

error: cannot resolve a prelude import

error[E0463]: can't find crate for `kani`
 --> lib.rs:1:3
  |
1 | #[kani::proof]
  |   ^^^^ can't find crate

error: cannot find macro `assert` in this scope
 --> lib.rs:3:5
  |
3 |     assert!(1 == 2);
  |     ^^^^^^

error: requires `sized` lang_item
 --> lib.rs:2:11
  |
2 |   fn main() {
  |  ___________^
3 | |     assert!(1 == 2);
4 | | }
  | |_^

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0463`.

Tested the suggestion in the errors to run rustup component add rust-src rustc-dev llvm-tools-preview, did not improve anything.

Default toolchain
nightly-2025-11-21-x86_64-unknown-linux-gnu rustc 1.93.0-nightly (53732d5e0 2025-11-20)

Metadata

Metadata

Assignees

No one assigned

    Labels

    [C] BugThis is a bug. Something isn't working.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions