-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor to use own function item type. * Add simple spec for impl blocks. * Extract functions in local impl block as well. * Adapt insertion sort to implementations. * Extract specs for impl functions. * Generate sibling specs with macros. * Allow multiple specs of the same type and deal with all function names. * Cache spec type on fn item. * Move make_and to stainless data. * Reconsider nested specs and add them to passing examples.
- Loading branch information
1 parent
9f73840
commit 62a338a
Showing
17 changed files
with
621 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
extern crate stainless; | ||
use stainless::*; | ||
|
||
pub fn is_cool() -> bool { | ||
#[pre(x > 0 && x < 100 && y > 0 && y < 100)] | ||
#[post(ret > 0)] | ||
fn inner_fn(x: i32, y: i32) -> i32 { | ||
x * y | ||
} | ||
|
||
inner_fn(2, 3) == 123 | ||
} | ||
|
||
pub fn main() { | ||
is_cool(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.