From 293fb0ef5371a9341f3149bebcc32ca142383add Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 10 Aug 2022 16:35:16 +0300 Subject: refactor(tvix/value): encapsulate attrset logic within value::attrs 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 Tested-by: BuildkiteCI --- tvix/eval/src/value/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tvix/eval/src/value/mod.rs') diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs index 55d44048b6..99c7ee8647 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), + 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"), } } } -- cgit 1.4.1