about summary refs log tree commit diff
path: root/tvix/eval/src/vm/generators.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-03-10T11·39+0300
committertazjin <tazjin@tvl.su>2023-03-13T20·30+0000
commitcbb4137dc08620af9d6360057c75891bf4d03b5f (patch)
tree8228a4e9cab70c0b81bd6fb4ab8f154767005938 /tvix/eval/src/vm/generators.rs
parentcd447e185989494200552c05b8b859fd72cefe95 (diff)
feat(tvix/eval): implement generator-based Nix equality logic r/5963
Adds a `Value::neo_nix_eq` method (the `neo_` prefix will be dropped
when we flip over to the generator implementation of the VM) which
implements Nix equality semantics using async, generator-based
comparisons.

Instead of tracking the "kind" of equality that is being compared (see
the pointer-equality doc) through a pair of booleans, I've introduced
an enum that explicitly lists the possible comparisons.

Change-Id: I3354cc1470eeccb3000a5ae24f2418db1a7a2edc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8241
Tested-by: BuildkiteCI
Reviewed-by: Adam Joseph <adam@westernsemico.com>
Diffstat (limited to 'tvix/eval/src/vm/generators.rs')
-rw-r--r--tvix/eval/src/vm/generators.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/tvix/eval/src/vm/generators.rs b/tvix/eval/src/vm/generators.rs
index 3b822b086346..2a6a8fa730d8 100644
--- a/tvix/eval/src/vm/generators.rs
+++ b/tvix/eval/src/vm/generators.rs
@@ -14,17 +14,13 @@ use smol_str::SmolStr;
 use std::fmt::Display;
 use std::future::Future;
 
-use crate::value::SharedThunkSet;
+use crate::value::{PointerEquality, SharedThunkSet};
 use crate::warnings::WarningKind;
 use crate::FileType;
 use crate::NixString;
 
 use super::*;
 
-/// Dummy type, before the actual implementation is in place.
-#[derive(Debug)]
-pub struct PointerEquality {}
-
 // -- Implementation of generic generator logic.
 
 /// States that a generator can be in while being driven by the VM.