about summary refs log tree commit diff
path: root/tvix/eval/src/builtins
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2022-11-22T04·04-0800
committerAdam Joseph <adam@westernsemico.com>2022-11-27T19·10+0000
commitdad8a7cbffbb0fac850e081e564eb09c67dd2fca (patch)
tree8b22a1affbe3c9175b68012caa5b849dd920c14e /tvix/eval/src/builtins
parented9aa0c32a5c14768f887b9c237ab80d7d6be254 (diff)
feat(tvix/eval): non-recursive implementation of nix_eq() r/5345
This passes all the function/thunk-pointer-equality tests in
cl/7369.

Change-Id: Ib47535ba2fc77a4f1c2cc2fd23d3a879e21d8b4c
Signed-off-by: Adam Joseph <adam@westernsemico.com>
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7358
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src/builtins')
-rw-r--r--tvix/eval/src/builtins/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index b2344a422e63..0003bddbf224 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -250,7 +250,7 @@ mod pure_builtins {
     #[builtin("elem")]
     fn builtin_elem(vm: &mut VM, x: Value, xs: Value) -> Result<Value, ErrorKind> {
         for val in xs.to_list()? {
-            if val.nix_eq(&x, vm)? {
+            if vm.nix_eq(val, x.clone(), true)? {
                 return Ok(true.into());
             }
         }