Rust
A systems language whose type system rules out most memory errors in safe code; increasingly used for infrastructure and security-critical components.
What do you want to prove about your Rust code?
Where proofs can attach
Toolchains that verify Rust directly, and those that verify what it compiles to. A proof about compiled code also relies on the compiler that produced it.
- Your code
- Intermediate code Proofs here are about the code the compiler produced
- Machine code Proofs here are about the binary itself
Verify Rust directly
Ranked by stage, feature coverage and trust.
| Toolchain | Stage | Trust | Effort | Feature coverage |
|---|---|---|---|---|
| Creusot Annotate Rust functions with contracts; Creusot translates the code to Why3, whose SMT solvers prove absence of panics and that the contracts hold. | Stage 1 · Usable | 0/5 | Auto-active | 11/19full, 6 partial |
| Verus 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. | Stage 1 · Usable | 0/5 | Auto-active | 8/19full, 9 partial |
| Aeneas (with Charon) Translate safe Rust into pure functions in Lean 4 (or F*, Rocq, HOL4) and prove properties there; the Lean kernel checks every proof. | Stage 1 · Usable | 1/5 | Interactive | 5/19full, 9 partial |
| Kani Rust Verifier Write test-like proof harnesses for Rust code; Kani checks every input the harness allows, up to loop bounds, and gives a counterexample when a check fails. | Stage 1 · Usable | 0/5 | Push-button | 9/19full, 7 partial |
Verify the compiled code
These prove facts about what the compiler produced, not about your source.
| Toolchain | Stage | Trust | Effort | Path |
|---|---|---|---|---|
| s2n-bignum Prove hand-written x86-64 or Arm64 assembly correct in HOL Light, on the exact bytes of the built object file; used for AWS's cryptography code. | Stage 1 · Usable | 4/5 | Interactive | LLVM IR (rustc, trusted) → x86-64 (LLVM backend (llc), trusted) |
| Alive2 Automatically checks that an optimized LLVM IR function still behaves like the original, or shows a counterexample. Loops are checked only up to a set bound. | Stage 1 · Usable | 1/5 | Push-button | LLVM IR (rustc, trusted) |
| Islaris Prove Arm or RISC-V machine code correct in Rocq, against the full official Sail ISA models, using Isla symbolic execution and an Iris separation logic. | Stage 0 · Research | 2/5 | Interactive | LLVM IR (rustc, trusted) → AArch64 (LLVM backend (llc), trusted) |
| LNSym Prove Armv8 (AArch64) machine code correct in Lean 4 by symbolic simulation over a hand-written model; aimed at AWS-LC cryptographic routines. | Stage 0 · Research | 2/5 | Interactive | LLVM IR (rustc, trusted) → AArch64 (LLVM backend (llc), trusted) |
Feature coverage
Which language features each toolchain handles. Hover or focus a mark for the note and source. Toolchains on compiled code are shown for common features only.
| Feature | Creusot | Verus | Aeneas (with Charon) | Kani Rust Verifier | s2n-bignum via x86-64 | Alive2 via LLVM IR | Islaris via AArch64 | LNSym via AArch64 |
|---|---|---|---|---|---|---|---|---|
| Common features | ||||||||
| Machine integersFixed-width integer arithmetic, overflow and bit operations. | Creusot, Machine integers: Supported.Machine integers with overflow checks. Source | Verus, Machine integers: Supported.Signed, unsigned and usize/isize arithmetic and bitwise operations are supported; overflow must be proved absent. Source | Aeneas (with Charon), Machine integers: Supported.Machine integers with overflow checks; an overflow makes the model fail. Source | Kani Rust Verifier, Machine integers: Supported.Bit-precise machine integers with overflow checks. Source | s2n-bignum, Machine integers: Unknown. | Alive2, Machine integers: Supported.Integers are encoded as SMT bit-vectors, including the nsw/nuw overflow flags. Source | Islaris, Machine integers: Unknown. | LNSym, Machine integers: Unknown. |
| Floating pointIEEE 754 floating-point arithmetic, including rounding and NaNs. | Creusot, Floating point: Partial.Basic float comparisons appear in the tests, but the test file carries a FIXME note saying that all of it should work. Source | Verus, Floating point: Partial.The feature table lists floating point as partially supported. Source | Aeneas (with Charon), Floating point: Unknown.Floating point is not mentioned in the documentation or the test suite. | Kani Rust Verifier, Floating point: Supported.Bit-precise IEEE 754 arithmetic. sin, cos and sqrt are over-approximated, which is sound but can report errors that cannot happen. Source | s2n-bignum, Floating point: Unknown. | Alive2, Floating point: Partial.IEEE-754 operations map to SMT floating-point theory (half, bfloat, float, double, fp128). Not supported: x86 80-bit and PowerPC double-double types. The 2021 paper notes that LLVM's frem rounds differently from SMT's remainder. Source | Islaris, Floating point: Unknown. | LNSym, Floating point: Unknown. |
| Heap and pointersDynamically allocated memory, pointers or references, and aliasing. | Creusot, Heap and pointers: Supported.Box and references are supported; raw pointers need ghost permission tokens (see unsafe). Source | Verus, Heap and pointers: Supported.References and Box, Rc and Arc are supported. Raw pointers are only partly supported (see unsafe). Source | Aeneas (with Charon), Heap and pointers: Partial.References and owned data (including Box) become plain values; raw pointers are not supported. Source | Kani Rust Verifier, Heap and pointers: Supported.Box, Rc and Arc are supported; null, dangling and out-of-bounds pointers are checked. Source | s2n-bignum, Heap and pointers: Unknown. | Alive2, Heap and pointers: Partial.Byte-level memory model with blocks and pointer provenance (CAV 2021 encoding). The 2021 paper's stated limitation: it assumes calls do not modify local variables whose address has escaped. Volatile and atomic accesses are unsupported. Source | Islaris, Heap and pointers: Unknown. | LNSym, Heap and pointers: Unknown. |
| Arrays and buffersIndexed memory such as arrays, slices, vectors and byte buffers. | Creusot, Arrays and buffers: Supported.Vec and slices have specifications. The standard vec! macro is not supported; use the replacement in creusot-std. Source | Verus, Arrays and buffers: Supported.Arrays, slices and Vec are supported; index expressions are listed as partially supported. Source | Aeneas (with Charon), Arrays and buffers: Supported.Arrays, slices and Vec are covered by tests and standard-library models. Source | Kani Rust Verifier, Arrays and buffers: Supported. Source | s2n-bignum, Arrays and buffers: Unknown. | Alive2, Arrays and buffers: Supported.Memory blocks are modeled as SMT arrays of bytes, so arrays and buffers are supported. Source | Islaris, Arrays and buffers: Unknown. | LNSym, Arrays and buffers: Unknown. |
| LoopsUnbounded loops, which need invariants or bounds to verify. | Creusot, Loops: Supported.Loop invariants; variants for termination. Source | Verus, Loops: Supported.loop and while with invariants are supported; for loops are partially supported. Source | Aeneas (with Charon), Loops: Partial.Loops become recursive helper functions. A return inside nested loops, or a break/continue to an outer loop, is not supported yet. Source | Kani Rust Verifier, Loops: Partial.Loops are unrolled up to a bound. Unwinding assertions fail if the bound is too small, so a passing run covers every execution of the harness. Without a bound Kani may not finish. Loop contracts (experimental) give unbounded proofs. Source | s2n-bignum, Loops: Unknown. | Alive2, Loops: Partial.Loops are unrolled up to a bound (-src-unroll and -tgt-unroll). The default bound is 0: any jump back to an already visited block is cut, so only paths that never repeat a loop body are compared. Bugs that need more iterations are missed. Source | Islaris, Loops: Unknown. | LNSym, Loops: Unknown. |
| RecursionFunctions that call themselves, directly or through others. | Creusot, Recursion: Supported.Terminating recursive functions need a variant; mutual recursion is not supported for them. Source | Verus, Recursion: Supported.Recursive functions with decreases clauses. Source | Aeneas (with Charon), Recursion: Supported.Recursive functions become recursive Lean definitions; termination may need a separate proof. Source | Kani Rust Verifier, Recursion: Partial.Recursion is unrolled up to the bound like loops; function contracts (experimental) can replace recursive calls. Source | s2n-bignum, Recursion: Unknown. | Alive2, Recursion: Partial.Each function is checked on its own, and calls (recursive or not) are treated as calls to an unknown function. Transformations that change behavior across function boundaries are not supported. Source | Islaris, Recursion: Unknown. | LNSym, Recursion: Unknown. |
| Higher-order codeFunction pointers, closures and callbacks. | Creusot, Higher-order code: Supported.Closures, including ones with mutable captures, are covered by the test suite. Source | Verus, Higher-order code: Partial.Closures are supported, but not mutable captures; function pointer types are not supported. Source | Aeneas (with Charon), Higher-order code: Partial.Simple closures work in the Lean backend; closures that capture mutable state are still commented out as TODO in the tests. Source | Kani Rust Verifier, Higher-order code: Partial.Closures and function pointer types are listed as partially supported. Unresolved function pointers are treated as a call to any function with a matching signature. Source | s2n-bignum, Higher-order code: Unknown. | Alive2, Higher-order code: Partial.Current code translates indirect calls through function pointers as calls to unknown functions. The 2021 paper still listed function pointers as unsupported. No source found on how precisely the target function is tracked. Source | Islaris, Higher-order code: Unknown. | LNSym, Higher-order code: Unknown. |
| Threads and shared memoryConcurrent threads with locks, atomics or message passing. | Creusot, Threads and shared memory: Partial.Specifications for threads and atomics exist in creusot-std; not yet covered by the guide. Source | Verus, Threads and shared memory: Partial.spawn/join, verified locks and Verus atomics work; std Mutex and RwLock do not. Source | Aeneas (with Charon), Threads and shared memory: Not supported.Not supported (README limitations). Source | Kani Rust Verifier, Threads and shared memory: Not supported.Concurrent code is compiled as sequential code with a warning; data races are not detected. Source | s2n-bignum, Threads and shared memory: Unknown. | Alive2, Threads and shared memory: Not supported.Atomic instructions and fences are rejected as unsupported. Source | Islaris, Threads and shared memory: Unknown. | LNSym, Threads and shared memory: Unknown. |
| I/O and system callsFiles, network, system calls and foreign-function calls. | Creusot, I/O and system calls: Unknown.creusot-std has an io module, but its coverage is not documented. Source | Verus, I/O and system calls: Not supported.Printing and I/O are listed as not supported; such calls must go through unverified code with assumed specifications. Source | Aeneas (with Charon), I/O and system calls: Partial.I/O and other external functions are not translated; you write a model for each one by hand, and Aeneas trusts it. Source | Kani Rust Verifier, I/O and system calls: Unknown.Kani replaces print macros with its own versions; support for file, network and other system calls is not documented. Source | s2n-bignum, I/O and system calls: Unknown. | Alive2, I/O and system calls: Partial.External calls are modeled as unknown functions that may change any memory. The 2021 paper names missing semantics for some string and I/O library functions as a common reason functions were skipped. Source | Islaris, I/O and system calls: Unknown. | LNSym, I/O and system calls: Unknown. |
| Standard librarySpecifications or models for the language's standard library. | Creusot, Standard library: Partial.creusot-std specifies parts of std (Vec, HashMap, Option, iterators, cells, threads and more), not all of it. Source | Verus, Standard library: Partial.The vstd library gives specifications for parts of std (Vec, HashMap, HashSet, VecDeque, Option, Result, Box, Rc, Arc). Many standard traits are only partly supported; Debug is not. Source | Aeneas (with Charon), Standard library: Partial.Aeneas ships Lean models for part of the Rust standard library; missing items need hand-written models. Source | Kani Rust Verifier, Standard library: Supported.The real standard library is compiled into the model, except a few functions Kani replaces with its own models, which are then trusted. Source | s2n-bignum, Standard library: Unknown. | Alive2, Standard library: Partial.As of the 2021 paper, 117 C library functions had special semantics, some only partly. Others are treated as unknown calls. Source | Islaris, Standard library: Unknown. | LNSym, Standard library: Unknown. |
| Rust-specific features | ||||||||
| References and borrowingShared and mutable references checked by the borrow checker. | Creusot, References and borrowing: Supported.Mutable borrows are modeled with prophecies (the value at the end of the borrow). Source | Verus, References and borrowing: Supported.Shared and mutable borrows are supported. Source | Aeneas (with Charon), References and borrowing: Partial.Shared and mutable borrows, including functions returning mutable borrows, are supported. Instantiating a generic type with a mutable reference is not supported yet. Source | Kani Rust Verifier, References and borrowing: Supported.References are handled like any other code, but Rust's aliasing rules are not checked. Source | · | · | · | · |
| Traits and genericsGeneric functions and types with trait bounds. | Creusot, Traits and generics: Supported.Traits with logical contracts are supported; recursive traits are rejected because they could make proofs unsound. Source | Verus, Traits and generics: Supported.User-defined traits, associated types and higher-ranked bounds are supported; generic associated types only with lifetimes. Source | Aeneas (with Charon), Traits and generics: Supported.Traits become Lean type classes. Source | Kani Rust Verifier, Traits and generics: Supported.Traits and implementations are listed as supported; type parameters as partial. Source | · | · | · | · |
| ClosuresAnonymous functions that capture their environment. | Creusot, Closures: Supported. Source | Verus, Closures: Partial.Closures without mutable captures. Source | Aeneas (with Charon), Closures: Partial.Closures without mutable captures, Lean backend only. Source | Kani Rust Verifier, Closures: Partial.Closure types are listed as partially supported. Source | · | · | · | · |
| unsafe and raw pointersCode inside unsafe blocks, raw pointer dereferences and FFI. | Creusot, unsafe and raw pointers: Partial.Raw pointers can be used with ghost permission tokens (Perm), as in the guide's linked-list tutorial; other unsafe code is not covered. Source | Verus, unsafe and raw pointers: Partial.Raw pointers are partially supported through vstd's permission-based raw_ptr API; transmute is not supported. Source | Aeneas (with Charon), unsafe and raw pointers: Not supported.Unsafe code is not supported; planned through separation-logic work. Source | Kani Rust Verifier, unsafe and raw pointers: Partial.Raw pointer dereferences are checked, but aliasing violations and invalid values are not by default, and inline assembly is not supported. Source | · | · | · | · |
| Interior mutabilityCell, RefCell, UnsafeCell and other mutation through shared references. | Creusot, Interior mutability: Partial.creusot-std provides cells with ghost permissions (PCell, PredCell) and a specification of std's cell module. Source | Verus, Interior mutability: Partial.Cell and RefCell from std are not used directly; Verus provides its own verified cell types (for example PCell) instead. Source | Aeneas (with Charon), Interior mutability: Not supported.The Aeneas paper excludes programs that rely on interior mutability. Source | Kani Rust Verifier, Interior mutability: Partial.Interior mutability is listed as supported, but UnsafeCell, which it is built on, is listed as partial. Source | · | · | · | · |
| Trait objectsdyn Trait values with dynamic dispatch. | Creusot, Trait objects: Partial.Only some traits may be used as dyn Trait, to avoid an unsoundness shown in the test suite. Source | Verus, Trait objects: Partial.Trait objects are listed as partially supported. Source | Aeneas (with Charon), Trait objects: Partial.Simple Box<dyn Trait> cases are in the test suite (Lean backend only); the extent of support is not documented. Source | Kani Rust Verifier, Trait objects: Partial.Trait object types are listed as partially supported. Source | · | · | · | · |
| IteratorsIterator chains such as map, filter and for loops over collections. | Creusot, Iterators: Supported.creusot-std specifies the Iterator trait and common adapters (map, filter, zip, enumerate and others). Source | Verus, Iterators: Partial.Iterators are listed as partially supported; the guide has a chapter on writing iterator specifications. Source | Aeneas (with Charon), Iterators: Partial.Tests cover iterators over ranges, arrays, slices and Vec and some adapters; there is no documented list of supported iterator methods. Source | Kani Rust Verifier, Iterators: Supported.Iterator code is compiled like any other code; loops over iterators still need unwinding bounds. Source | · | · | · | · |
| PanicsPanicking operations (unwrap, indexing, overflow in debug builds) and their absence. | Creusot, Panics: Supported.Absence of panics is proved, except Vec capacity overflow (see no-ub). Source | Verus, Panics: Supported.Verified code is proved panic free (except resource exhaustion). Panic unwinding itself is partially supported. Source | Aeneas (with Charon), Panics: Supported.Panics, overflow and out-of-bounds accesses are modeled as failures that proofs must rule out. Source | Kani Rust Verifier, Panics: Supported.All panic paths are checked. Stack unwinding after a panic is not modeled. Source | · | · | · | · |
| async / awaitAsynchronous functions and futures. | Creusot, async / await: Unknown.Not mentioned in the guide. | Verus, async / await: Not supported.async functions, async blocks and await are not supported. Source | Aeneas (with Charon), async / await: Unknown.Not mentioned in the documentation. | Kani Rust Verifier, async / await: Not supported.await expressions are listed as not supported. Source | · | · | · | · |
Supported Partial Not supported Unknown
Formal semantics of Rust
Models that proofs about Rust can be stated against. See formal semanticsFormal semantics. A precise, mathematical definition of what programs in a language do..
- a-mir-formality Not staged
An early-stage, executable model of Rust's type system, trait solver and borrow checker, written as inference rules in Rust and maintained by members of the Rust types team.
- MiniRust Not staged
An executable specification of what Rust programs do at run time, including exactly which unsafe operations are undefined behavior. It describes an idealized MIR-like core language that Rust is translated into.
Compilers from Rust
What each compilation step preserves, and whether it is proved.