Proving that your Rust code is correct under concurrency
Correctness of code with threads or shared memory: absence of data races, deadlock freedom, linearizability of concurrent data structures.
Change the question
Ranked by: support for this property, stage, coverage of the features you pick, and trust. Tools that work on compiled code rank lower. Ranking as JSON.
-
Annotate Rust functions with contracts; Creusot translates the code to Why3, whose SMT solvers prove absence of panics and that the contracts hold.
Partial.creusot-std has specifications for threads and atomics and ghost invariants, but the guide does not document concurrent verification yet.
Source Partial — creusot-std has specifications for threads and atomics and ghost invariants, but the guide does not document concurrent verification yet.- Effort
- Auto-active
- Covers
- 11 of 19 Rust features
- Relies on
- SMT solvers (Alt-Ergo, Z3, cvc5) run through Why3 decide; no proof certificates. Rust model built into Creusot's translation; no published validation against rustc.
Stage 1 · Usable 0/5 strong -
Write specifications and proofs next to your Rust code; Verus turns them into questions for the Z3 solver and checks them for every possible run.
Partial.Threads (spawn/join), verified locks, atomics with ghost invariants and logically atomic specifications are supported through Verus's own libraries. The standard library's Mutex and RwLock are not supported.
Source Partial — Threads (spawn/join), verified locks, atomics with ghost invariants and logically atomic specifications are supported through Verus's own libraries. The standard library's Mutex and RwLock are not supported.- Effort
- Auto-active
- Covers
- 8 of 19 Rust features
- Relies on
- The Z3 SMT solver decides each proof obligation; no proof certificate is kept. Rust's meaning is built into Verus's encoding; no published validation against rustc.
Stage 1 · Usable 0/5 strong
No option matches this effort level.
Verify Rust, but not this property
- Kani Rust Verifier — Concurrent code is out of scope; Kani emits a warning and compiles it as if it were sequential.
- Aeneas (with Charon) — Concurrency is not supported; the README says support is planned through ongoing separation-logic work.
- Alive2 — Atomic and volatile loads and stores, atomicrmw, cmpxchg and fence are rejected as unsupported by the LLVM-to-Alive2 converter.
- s2n-bignum — The machine model is sequential and single-core.
- Islaris — The paper states Islaris assumes single-threaded execution.
- LNSym — The machine state is a single sequential processor.
Ask something else about Rust
- Everything
- No undefined behavior
- Functional correctness
- Equivalence
- Information flow
- Termination and liveness
New to this? Start with the glossary: auto-activeAuto-active verification. You write specifications and hints in the code; an automatic solver does the proving., interactiveInteractive theorem prover. A proof assistant where you write proofs step by step and the system checks each step., trusted computing baseTrusted computing base (TCB). Everything that must be correct for a proof to mean what it says..