From 3e188d4f8e484019e1f04662cfaef4213e24ceed Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 13 Sep 2022 16:17:07 +0300 Subject: fix(tvix/eval): add branch for directly comparing two thunks Pointed out by sterni in cl/6370 Change-Id: I324d8049a2702ced8f30ad43a64d63ae79dd0eab Reviewed-on: https://cl.tvl.fyi/c/depot/+/6569 Reviewed-by: sterni Tested-by: BuildkiteCI --- tvix/eval/src/value/mod.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'tvix') diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs index 46ad65c5025e..6baa8b666ed6 100644 --- a/tvix/eval/src/value/mod.rs +++ b/tvix/eval/src/value/mod.rs @@ -169,6 +169,7 @@ impl PartialEq for Value { // compared instead. The compiler should ensure that // thunks under comparison have been forced, otherwise it // is a bug. + (Value::Thunk(lhs), Value::Thunk(rhs)) => &*lhs.value() == &*rhs.value(), (Value::Thunk(lhs), rhs) => &*lhs.value() == rhs, (lhs, Value::Thunk(rhs)) => lhs == &*rhs.value(), -- cgit 1.4.1