feat(tvix/eval): add Closure::ptr_eq()
See cl/7368 Change-Id: I97630994c3d65f4d16414a0da236ce000a5b6d33 Signed-off-by: Adam Joseph <adam@westernsemico.com> Reviewed-on: https://cl.tvl.fyi/c/depot/+/7374 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
This commit is contained in:
parent
0616976f7c
commit
6b986de92b
1 changed files with 6 additions and 0 deletions
|
@ -79,6 +79,12 @@ impl Closure {
|
|||
)
|
||||
}
|
||||
|
||||
/// Do not call this function unless you have read
|
||||
/// `tvix/docs/value-pointer-equality.md` carefully.
|
||||
pub fn ptr_eq(&self, other: &Self) -> bool {
|
||||
Rc::ptr_eq(&self.lambda, &other.lambda) && Rc::ptr_eq(&self.upvalues, &other.upvalues)
|
||||
}
|
||||
|
||||
pub fn new_with_upvalues(upvalues: Rc<Upvalues>, lambda: Rc<Lambda>) -> Self {
|
||||
Closure {
|
||||
upvalues,
|
||||
|
|
Loading…
Reference in a new issue