From 80da4e32570092cf4289ff2265bfa2c125311b0e Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 21 Sep 2023 15:53:29 +0200 Subject: [PATCH] Use opaque reference --- crates/ir/src/module.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ir/src/module.rs b/crates/ir/src/module.rs index c9bef630..5e68d721 100644 --- a/crates/ir/src/module.rs +++ b/crates/ir/src/module.rs @@ -91,12 +91,12 @@ pub struct FuncRef(u32); entity_impl!(FuncRef); pub struct DisplayCalleeFuncRef<'a> { - callee: &'a FuncRef, + callee: FuncRef, func: &'a Function, } impl<'a> DisplayCalleeFuncRef<'a> { - pub fn new(callee: &'a FuncRef, func: &'a Function) -> Self { + pub fn new(callee: FuncRef, func: &'a Function) -> Self { Self { callee, func } } } @@ -104,7 +104,7 @@ impl<'a> DisplayCalleeFuncRef<'a> { impl<'a> fmt::Display for DisplayCalleeFuncRef<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let Self { callee, func } = *self; - let sig = func.callees.get(callee).unwrap(); + let sig = func.callees.get(&callee).unwrap(); write!(f, "{}", sig.name()) } }