Skip to content

Commit

Permalink
Better unsupported construct messages (rust-lang#1725)
Browse files Browse the repository at this point in the history
  • Loading branch information
tedinski authored Sep 28, 2022
1 parent 21ceaa2 commit d86dc3b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion kani-compiler/src/codegen_cprover_gotoc/codegen/rvalue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ impl<'tcx> GotocCtx<'tcx> {
let drop_sym = self.ensure(&drop_sym_name, |ctx, name| {
// Function body
let unimplemented = ctx.codegen_unimplemented_stmt(
format!("drop_in_place for {}", drop_sym_name).as_str(),
format!("drop_in_place for {}", drop_instance).as_str(),
Location::none(),
"https://github.com/model-checking/kani/issues/281",
);
Expand Down
8 changes: 6 additions & 2 deletions kani-compiler/src/codegen_cprover_gotoc/codegen/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ impl<'tcx> GotocCtx<'tcx> {
if !(typ.is_trait() || typ.is_box()) {
warn!(self_type=?typ, "Unsupported drop of unsized");
return self.codegen_unimplemented_stmt(
format!("Unsupported drop unsized struct: {:?}", typ).as_str(),
format!("drop unsized struct for {:?}", typ).as_str(),
loc,
"https://github.com/model-checking/kani/issues/1072",
);
Expand Down Expand Up @@ -383,7 +383,11 @@ impl<'tcx> GotocCtx<'tcx> {
func.call(args).as_stmt(loc)
} else {
self.codegen_unimplemented_stmt(
format!("drop_in_place call for {:?}", func).as_str(),
format!(
"drop_in_place call for {}",
self.readable_instance_name(drop_instance)
)
.as_str(),
loc,
"https://github.com/model-checking/kani/issues/426",
)
Expand Down
4 changes: 2 additions & 2 deletions tests/expected/drop/expected
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Description: "assertion failed: self.id == 1"\
in function <DummyImpl as std::ops::Drop>::drop

Status: FAILURE\
Description: "Unsupported drop unsized struct: Wrapper<dyn DummyTrait> is not currently supported by Kani. Please post your example at https://github.com/model-checking/kani/issues/1072"
Description: "drop unsized struct for Wrapper<dyn DummyTrait> is not currently supported by Kani. Please post your example at https://github.com/model-checking/kani/issues/1072"


Failed Checks: Unsupported drop unsized struct: Wrapper<dyn DummyTrait> is not currently supported by Kani. Please post your example at https://github.com/model-checking/kani/issues/1072
Failed Checks: drop unsized struct for Wrapper<dyn DummyTrait> is not currently supported by Kani. Please post your example at https://github.com/model-checking/kani/issues/1072

VERIFICATION:- FAILED

Expand Down

0 comments on commit d86dc3b

Please sign in to comment.