From 06494742062e77036827dfc7c91dea507b44447f Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 31 Oct 2022 17:13:38 -0700 Subject: fix(tvix/eval): remove impl PartialEq for Value It isn't possible to implement PartialEq properly for Value, because any sensible implementation needs to force() thunks, which cannot be done without a `&mut VM`. The existing derive(PartialEq) has false negatives, which caused the bug which cl/7142 fixed. Fortunately that bug was easy to find, but a silent false negative deep within the bowels of nixpkgs could be a real nightmare to hunt down. Let's just remove the PartialEq impl for Value, and the other derive(PartialEq)'s that depend on it. Signed-off-by: Adam Joseph Change-Id: Iacd3726fefc7fc1edadcd7e9b586e04cf8466775 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7144 Reviewed-by: kanepyork Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/eval/src/value/thunk.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tvix/eval/src/value/thunk.rs') diff --git a/tvix/eval/src/value/thunk.rs b/tvix/eval/src/value/thunk.rs index bcf8e2fc87..549534b04e 100644 --- a/tvix/eval/src/value/thunk.rs +++ b/tvix/eval/src/value/thunk.rs @@ -41,7 +41,7 @@ use super::{Lambda, TotalDisplay}; /// Upvalues must be finalised before leaving the initial state /// (Suspended or RecursiveClosure). The [`value()`] function may /// not be called until the thunk is in the final state (Evaluated). -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug)] enum ThunkRepr { /// Thunk is closed over some values, suspended and awaiting /// execution. @@ -63,7 +63,7 @@ enum ThunkRepr { /// evaluation due to self-reference or lazy semantics (or both). /// Every reference cycle involving `Value`s will contain at least /// one `Thunk`. -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug)] pub struct Thunk(Rc>); impl Thunk { -- cgit 1.4.1