diff options
author | Vincent Ambo <mail@tazj.in> | 2022-08-10T13·35+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-08-24T18·19+0000 |
commit | 293fb0ef5371a9341f3149bebcc32ca142383add (patch) | |
tree | ae9c9d2be492fbe1944bb00347577b0b321d35f9 /tvix/eval/src/value/mod.rs | |
parent | 6edbfe3cbaecbca0ecbab7f49adfe96ec5268f8b (diff) |
refactor(tvix/value): encapsulate attrset logic within value::attrs r/4454
The internal optimisations of the set representation were previously leaking into the VM, which is highly undesirable. Keeping it encapsulated allows us to do additional optimisations within value::attrs without being concerned about its use in the VM. Change-Id: I7e7020bb0983b9d355d3db747b049b2faa60131f Reviewed-on: https://cl.tvl.fyi/c/depot/+/6108 Reviewed-by: eta <tvl@eta.st> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/value/mod.rs')
-rw-r--r-- | tvix/eval/src/value/mod.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs index 55d44048b6bc..99c7ee8647c3 100644 --- a/tvix/eval/src/value/mod.rs +++ b/tvix/eval/src/value/mod.rs @@ -25,6 +25,7 @@ pub enum Value { // Internal values that, while they technically exist at runtime, // are never returned to or created directly by users. AttrPath(Vec<NixString>), + Blackhole, } impl Value { @@ -47,7 +48,7 @@ impl Value { Value::List(_) => "list", // Internal types - Value::AttrPath(_) => "internal", + Value::AttrPath(_) | Value::Blackhole => "internal", } } @@ -85,7 +86,7 @@ impl Display for Value { Value::List(list) => list.fmt(f), // internal types - Value::AttrPath(_) => f.write_str("internal"), + Value::AttrPath(_) | Value::Blackhole => f.write_str("internal"), } } } |