Crate creusot_contracts

source ·
Expand description

The “standard library” of Creusot.

To start using Creusot, you should always import that crate. The recommended way is to have a glob import:

use creusot_contracts::*;

§Writing specifications

To start writing specification, use the requires and ensures macros:

use creusot_contracts::*;

#[requires(x < i32::MAX)]
#[ensures(result@ == x@ + 1)]
fn add_one(x: i32) -> i32 {
    x + 1
}

For a more detailed explanation, see the guide.

Re-exports§

Modules§

Macros§