Skip to content

Commit 0bde3ea

Browse files
expect() does not take format strings (rust-lang#2865)
This would just print ```` Function `{func}` should've been declared before usage' ```` on panic, it just now occurred to me that `func` is supposed to be content of a var 😄 Co-authored-by: Zyad Hassan <[email protected]>
1 parent b291e73 commit 0bde3ea

File tree

1 file changed

+2
-2
lines changed
  • kani-compiler/src/codegen_cprover_gotoc/codegen

1 file changed

+2
-2
lines changed

kani-compiler/src/codegen_cprover_gotoc/codegen/operand.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,8 @@ impl<'tcx> GotocCtx<'tcx> {
716716
trace!(func=?instance, "codegen_func_symbol");
717717
let func = self.symbol_name(instance);
718718
self.symbol_table
719-
.lookup(func)
720-
.expect("Function `{func}` should've been declared before usage")
719+
.lookup(&func)
720+
.unwrap_or_else(|| panic!("Function `{func}` should've been declared before usage"))
721721
};
722722
(sym, funct)
723723
}

0 commit comments

Comments
 (0)