Skip to content

Commit

Permalink
Use opaque reference
Browse files Browse the repository at this point in the history
  • Loading branch information
k0aki committed Sep 28, 2023
1 parent 9d75025 commit 80da4e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/ir/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,20 @@ 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 }
}
}

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())
}
}

0 comments on commit 80da4e3

Please sign in to comment.