Skip to content

Commit

Permalink
Port some changes from Prusti
Browse files Browse the repository at this point in the history
  • Loading branch information
fpoli committed Mar 25, 2024
1 parent 7f09b70 commit 170821b
Show file tree
Hide file tree
Showing 492 changed files with 30 additions and 87,678 deletions.
668 changes: 18 additions & 650 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ members = [
"prusti-viper",
"prusti-server",
"prusti-launch",
"prusti-smt-solver",
"prusti-rustc-interface",
"smt-log-analyzer",
"test-crates",
"viper",
"viper-sys",
"vir",
Expand Down
22 changes: 6 additions & 16 deletions prusti-contracts/prusti-specs/src/rewriter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,30 +105,20 @@ impl AstRewriter {
// - `item_span` is set to `expr.span()` so that any errors reported
// for the spec item will be reported on the span of the expression
// written by the user
// - `((#expr) : bool)` syntax is used to report type errors in the
// - `let ...: bool = #expr` syntax is used to report type errors in the
// expression with the correct error message, i.e. that the expected
// type is `bool`, not that the expected *return* type is `bool`
// - `!!(...)` is used to fix an edge-case when the expression consists
// of a single identifier; without the double negation, the `Return`
// terminator in MIR has a span set to the one character just after
// the identifier
let (return_type, return_modifier) = if spec_type == SpecItemType::Termination {
(
quote_spanned! {item_span => Int},
quote_spanned! {item_span => Int::new(0) + },
)
} else {
(
quote_spanned! {item_span => bool},
quote_spanned! {item_span => !!},
)
let return_type = match &spec_type {
SpecItemType::Termination => quote_spanned! {item_span => Int},
_ => quote_spanned! {item_span => bool},
};
let mut spec_item: syn::ItemFn = parse_quote_spanned! {item_span=>
#[allow(unused_must_use, unused_parens, unused_variables, dead_code, non_snake_case)]
#[prusti::spec_only]
#[prusti::spec_id = #spec_id_str]
fn #item_name() -> #return_type {
#return_modifier ((#expr) : #return_type)
let prusti_result: #return_type = #expr;
prusti_result
}
};

Expand Down
18 changes: 0 additions & 18 deletions prusti-smt-solver/Cargo.toml

This file was deleted.

115 changes: 0 additions & 115 deletions prusti-smt-solver/src/context.rs

This file was deleted.

47 changes: 0 additions & 47 deletions prusti-smt-solver/src/solver.rs

This file was deleted.

105 changes: 0 additions & 105 deletions prusti-smt-solver/src/subprocess.rs

This file was deleted.

Loading

0 comments on commit 170821b

Please sign in to comment.