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 <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2022-09-13 16:17:07 +03:00 committed by tazjin
parent 6fdf55a975
commit 3e188d4f8e

View file

@ -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(),