Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
qinheping committed Nov 7, 2024
1 parent 95afb37 commit fbf71ae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl<'tcx> GotocCtx<'tcx> {
unsupported_constructs: FxHashMap::default(),
concurrent_constructs: FxHashMap::default(),
transformer,
has_loop_contracts: false
has_loop_contracts: false,
}
}
}
Expand Down
6 changes: 1 addition & 5 deletions kani-driver/src/call_goto_instrument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,7 @@ impl KaniSession {
}

/// Apply annotated function contracts and loop contracts with goto-instrument.
pub fn instrument_contracts(
&self,
harness: &HarnessMetadata,
file: &Path,
) -> Result<()> {
pub fn instrument_contracts(&self, harness: &HarnessMetadata, file: &Path) -> Result<()> {
// Do nothing if neither loop contracts nor function contracts is enabled.
if !harness.has_loop_contracts && harness.contract.is_none() {
return Ok(());
Expand Down
2 changes: 2 additions & 0 deletions kani_metadata/src/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ pub struct HarnessMetadata {
pub attributes: HarnessAttributes,
/// A CBMC-level assigns contract that should be enforced when running this harness.
pub contract: Option<AssignsContract>,
/// If the harness contains some usage of loop contracts.
pub has_loop_contracts: bool,
}

/// The attributes added by the user to control how a harness is executed.
Expand Down
2 changes: 1 addition & 1 deletion tests/expected/loop-contract/multiple_loops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn simple_while_loops() {
/// Check that `loop-contracts` works correctly for harness
/// without loop contracts.
#[kani::proof]
fn no_loop_harness(){
fn no_loop_harness() {
let x = 2;
assert!(x == 2);
}
Expand Down

0 comments on commit fbf71ae

Please sign in to comment.