Skip to content

Commit bfebfdb

Browse files
committed
fix formatting & regression failures
1 parent eaab5cf commit bfebfdb

File tree

10 files changed

+43
-22
lines changed

10 files changed

+43
-22
lines changed

kani-compiler/src/kani_middle/codegen_units.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ impl CodegenUnits {
104104
// and these harnesses have no stubs.
105105
units.extend(
106106
automatic_harnesses
107-
.iter()
108-
.map(|(harness, _)| CodegenUnit {
107+
.keys()
108+
.map(|harness| CodegenUnit {
109109
harnesses: vec![*harness],
110110
stubs: HashMap::default(),
111111
})

kani-driver/src/args/autoverify_args.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl ValidateArgs for CargoAutoverifyArgs {
7171
ErrorKind::MissingRequiredArgument,
7272
format!(
7373
"The `autoverify` subcommand is unstable and requires -Z {}",
74-
UnstableFeature::UnstableOptions.to_string()
74+
UnstableFeature::UnstableOptions
7575
),
7676
));
7777
}
@@ -105,7 +105,7 @@ impl ValidateArgs for StandaloneAutoverifyArgs {
105105
ErrorKind::MissingRequiredArgument,
106106
format!(
107107
"The `autoverify` subcommand is unstable and requires -Z {}",
108-
UnstableFeature::UnstableOptions.to_string()
108+
UnstableFeature::UnstableOptions
109109
),
110110
));
111111
}

kani-driver/src/harness_runner.rs

+20-18
Original file line numberDiff line numberDiff line change
@@ -167,29 +167,31 @@ impl KaniSession {
167167
harness: &HarnessMetadata,
168168
) -> Result<VerificationResult> {
169169
let thread_index = rayon::current_thread_index().unwrap_or_default();
170-
// If the harness is automatically generated, pretty_name refers to the function under verification.
171-
let mut msg = if harness.is_automatically_generated {
172-
if matches!(harness.attributes.kind, HarnessKind::Proof) {
173-
format!(
174-
"Autoverify: Checking function {} against all possible inputs...",
175-
harness.pretty_name
176-
)
170+
if !self.args.common_args.quiet {
171+
// If the harness is automatically generated, pretty_name refers to the function under verification.
172+
let mut msg = if harness.is_automatically_generated {
173+
if matches!(harness.attributes.kind, HarnessKind::Proof) {
174+
format!(
175+
"Autoverify: Checking function {} against all possible inputs...",
176+
harness.pretty_name
177+
)
178+
} else {
179+
format!(
180+
"Autoverify: Checking function {}'s contract against all possible inputs...",
181+
harness.pretty_name
182+
)
183+
}
177184
} else {
178-
format!(
179-
"Autoverify: Checking function {}'s contract against all possible inputs...",
180-
harness.pretty_name
181-
)
185+
format!("Checking harness {}...", harness.pretty_name)
186+
};
187+
188+
if rayon::current_num_threads() > 1 {
189+
msg = format!("Thread {thread_index}: {msg}");
182190
}
183-
} else {
184-
format!("Checking harness {}...", harness.pretty_name)
185-
};
186191

187-
if rayon::current_num_threads() > 1 {
188-
msg = format!("Thread {thread_index}: {msg}");
192+
println!("{msg}");
189193
}
190194

191-
println!("{msg}");
192-
193195
let mut result = self.with_timer(|| self.run_cbmc(binary, harness), "run_cbmc")?;
194196

195197
self.process_output(&result, harness, thread_index);

kani-driver/src/metadata.rs

+1
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ pub mod tests {
228228
goto_file: model_file,
229229
contract: Default::default(),
230230
has_loop_contracts: false,
231+
is_automatically_generated: false,
231232
}
232233
}
233234

tests/script-based-pre/cargo_autoverify_contracts/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright Kani Contributors
2+
# SPDX-License-Identifier: Apache-2.0 OR MIT
3+
14
[package]
25
name = "cargo_autoverify_contracts"
36
version = "0.1.0"

tests/script-based-pre/cargo_autoverify_exclude/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright Kani Contributors
2+
# SPDX-License-Identifier: Apache-2.0 OR MIT
3+
14
[package]
25
name = "cargo_autoverify_include"
36
version = "0.1.0"

tests/script-based-pre/cargo_autoverify_filter/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright Kani Contributors
2+
# SPDX-License-Identifier: Apache-2.0 OR MIT
3+
14
[package]
25
name = "cargo_autoverify_filter"
36
version = "0.1.0"

tests/script-based-pre/cargo_autoverify_harnesses_fail/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright Kani Contributors
2+
# SPDX-License-Identifier: Apache-2.0 OR MIT
3+
14
[package]
25
name = "cargo_autoverify_harnesses_fail"
36
version = "0.1.0"

tests/script-based-pre/cargo_autoverify_include/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright Kani Contributors
2+
# SPDX-License-Identifier: Apache-2.0 OR MIT
3+
14
[package]
25
name = "cargo_autoverify_include"
36
version = "0.1.0"

tests/script-based-pre/cargo_autoverify_loops_fixme/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright Kani Contributors
2+
# SPDX-License-Identifier: Apache-2.0 OR MIT
3+
14
[package]
25
name = "cargo_autoverify_loops_fixme"
36
version = "0.1.0"

0 commit comments

Comments
 (0)