From 0bde3ea97ac4fb2df791248e887b915cea6244df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 8 Nov 2023 17:57:35 +0100 Subject: [PATCH] expect() does not take format strings (#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 :smile: Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com> --- kani-compiler/src/codegen_cprover_gotoc/codegen/operand.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kani-compiler/src/codegen_cprover_gotoc/codegen/operand.rs b/kani-compiler/src/codegen_cprover_gotoc/codegen/operand.rs index bd2df19afcc5..d297d9d90a52 100644 --- a/kani-compiler/src/codegen_cprover_gotoc/codegen/operand.rs +++ b/kani-compiler/src/codegen_cprover_gotoc/codegen/operand.rs @@ -716,8 +716,8 @@ impl<'tcx> GotocCtx<'tcx> { trace!(func=?instance, "codegen_func_symbol"); let func = self.symbol_name(instance); self.symbol_table - .lookup(func) - .expect("Function `{func}` should've been declared before usage") + .lookup(&func) + .unwrap_or_else(|| panic!("Function `{func}` should've been declared before usage")) }; (sym, funct) }