From d952b29fca09c33ee297d0eb65a15dbf2b7cdf45 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 12 Aug 2022 17:19:14 +0300 Subject: chore(tvix/eval): add variant_size_differences warning for OpCode 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 --- tvix/eval/src/opcode.rs | 1 + 1 file changed, 1 insertion(+) 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. -- cgit 1.4.1