Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions kani-compiler/src/kani_middle/codegen_units.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,14 +425,14 @@ fn automatic_harness_partition(
if !implements_arbitrary {
// Find the name of the argument by referencing var_debug_info.
// Note that enumerate() starts at 0, while StableMIR argument_index starts at 1, hence the idx+1.
let arg_debug_info = body
let arg_name = body
.var_debug_info
.iter()
.find(|var| {
var.argument_index.is_some_and(|arg_idx| idx + 1 == usize::from(arg_idx))
})
.expect("Arguments should have corresponding var debug info");
problematic_args.push(arg_debug_info.name.to_string())
.map_or("_".to_string(), |debug_info| debug_info.name.to_string());
problematic_args.push(arg_name)
}
}
if !problematic_args.is_empty() {
Expand Down
3 changes: 2 additions & 1 deletion kani-compiler/src/kani_middle/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ pub fn gen_automatic_proof_metadata(

// Leave the concrete playback instrumentation for now, but this feature does not actually support concrete playback.
let loc = SourceLocation::new(fn_to_verify.body().unwrap().span);
let file_stem = format!("{}_{mangled_name}", base_name.file_stem().unwrap().to_str().unwrap());
let file_stem =
format!("{}_{mangled_name}_autoharness", base_name.file_stem().unwrap().to_str().unwrap());
let model_file = base_name.with_file_name(file_stem).with_extension(ArtifactType::SymTabGoto);

let kani_attributes = KaniAttributes::for_instance(tcx, *fn_to_verify);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ If you believe that the provided reason is incorrect and Kani should have genera
|----------------------------------------+------------------------------------------------------|
| no_harness::unsupported_mut_pointer | Missing Arbitrary implementation for argument(s): _y |
|----------------------------------------+------------------------------------------------------|
| no_harness::unsupported_no_arg_name | Missing Arbitrary implementation for argument(s): _ |
|----------------------------------------+------------------------------------------------------|
| no_harness::unsupported_ref | Missing Arbitrary implementation for argument(s): _y |
|----------------------------------------+------------------------------------------------------|
| no_harness::unsupported_slice | Missing Arbitrary implementation for argument(s): _y |
Expand Down
3 changes: 3 additions & 0 deletions tests/script-based-pre/cargo_autoharness_filter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,7 @@ mod no_harness {
) -> DoesntImplementArbitrary {
x
}
// Test that we correctly render the name of the argument "_" in the table of skipped functions
// (this argument will have no var_debug_info from StableMIR, unlike arguments with names)
fn unsupported_no_arg_name(_: &()) {}
}
Loading