about summary refs log tree commit diff
path: root/tvix/eval/src/value/function.rs
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2022-11-27T08·54-0800
committertazjin <tazjin@tvl.su>2022-12-21T14·50+0000
commite04b1697e4f4e8236418571c1f5938f0a9717bb7 (patch)
tree99da7ffabdcd33bf3ed64b9981bc62bbac13e246 /tvix/eval/src/value/function.rs
parentb3c34c3c6104824733baae2d892eeabd423681a2 (diff)
feat(tvix/eval): wrap Closure in Rc<> to match cppnix semantics r/5452
Change-Id: I595087eff943d38a9fc78a83d37e207bb2ab79bc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7443
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/value/function.rs')
-rw-r--r--tvix/eval/src/value/function.rs16
1 files changed, 1 insertions, 15 deletions
diff --git a/tvix/eval/src/value/function.rs b/tvix/eval/src/value/function.rs
index 7a21223e0400..4c2f3514f018 100644
--- a/tvix/eval/src/value/function.rs
+++ b/tvix/eval/src/value/function.rs
@@ -66,9 +66,6 @@ impl Lambda {
 pub struct Closure {
     pub lambda: Rc<Lambda>,
     pub upvalues: Rc<Upvalues>,
-    /// true if all upvalues have been realised
-    #[cfg(debug_assertions)]
-    pub is_finalised: bool,
 }
 
 impl Closure {
@@ -79,19 +76,8 @@ 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,
-            lambda,
-            #[cfg(debug_assertions)]
-            is_finalised: true,
-        }
+        Closure { upvalues, lambda }
     }
 
     pub fn chunk(&self) -> &Chunk {