about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-12T14·19+0300
committertazjin <tazjin@tvl.su>2022-08-26T20·32+0000
commitd952b29fca09c33ee297d0eb65a15dbf2b7cdf45 (patch)
tree8880ff40e67a1d65bab8f89e4887ef8decf0d2ab
parente70ef017ff3ff1c3aab6023b950b9206773d44dd (diff)
chore(tvix/eval): add variant_size_differences warning for OpCode r/4510
This makes it possible to quickly detect code errors that might blow
up the size of the OpCode type.

Change-Id: I7662dd0aa30c4762c0f9e4fa346418c9ca8b9994
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6177
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
-rw-r--r--tvix/eval/src/opcode.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/tvix/eval/src/opcode.rs b/tvix/eval/src/opcode.rs
index b072febd42fb..4cf4f695b0c7 100644
--- a/tvix/eval/src/opcode.rs
+++ b/tvix/eval/src/opcode.rs
@@ -7,6 +7,7 @@ pub struct ConstantIdx(pub usize);
 #[derive(Clone, Copy, Debug)]
 pub struct CodeIdx(pub usize);
 
+#[warn(variant_size_differences)]
 #[derive(Clone, Copy, Debug)]
 pub enum OpCode {
     // Push a constant onto the stack.