about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-09-13T13·19+0300
committertazjin <tazjin@tvl.su>2022-09-13T14·41+0000
commitf69e83ae7b2840d0c0d9633348beeb88605a56f0 (patch)
tree5923ddf84ea65059ac38f6838aae1b9579e6a798
parent3e188d4f8e484019e1f04662cfaef4213e24ceed (diff)
refactor(tvix/eval): cover all Value variants in force_for_output r/4846
Avoids accidentally dropping one on the floor if we add more, pointed
out by sterni in cl/6372

Change-Id: Ib7bb0ce9c8331c8337003d20c4d5240dfae1c32a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6570
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
-rw-r--r--tvix/eval/src/vm.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs
index ca024c9d65ec..d886bf24b939 100644
--- a/tvix/eval/src/vm.rs
+++ b/tvix/eval/src/vm.rs
@@ -715,7 +715,14 @@ impl<'o> VM<'o> {
                 panic!("tvix bug: internal value left on stack: {:?}", value)
             }
 
-            _ => Ok(()),
+            Value::Null
+            | Value::Bool(_)
+            | Value::Integer(_)
+            | Value::Float(_)
+            | Value::String(_)
+            | Value::Path(_)
+            | Value::Closure(_)
+            | Value::Builtin(_) => Ok(()),
         }
     }