From 06ec4bebe7e3a9a06a7f300f0a9f7c090d809f08 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Mon, 10 Oct 2022 16:50:28 -0400 Subject: fix(tvix/eval): Actually trace spans for thunks Currently, the span on *all* thunk force errors is the span at which the thunk is forced, which for recursive thunk forcing ends up just being the same span over and over again. This changes the span on thunk force errors to be the span at which point the thunk is *created*, which is a bit more helpful (though the printing atm is a little... crowded). To make this work, we have to thread through the span at which a thunk is created into a field on the thunk itself. Change-Id: I81474810a763046e2eb3a8f07acf7d8ec708824a Reviewed-on: https://cl.tvl.fyi/c/depot/+/6932 Autosubmit: grfn Reviewed-by: Adam Joseph Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/eval/src/compiler/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tvix/eval/src/compiler') diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs index fa08d626aa..9bd37cef85 100644 --- a/tvix/eval/src/compiler/mod.rs +++ b/tvix/eval/src/compiler/mod.rs @@ -940,7 +940,7 @@ impl Compiler<'_> { // Emit the thunk directly if it does not close over the // environment. if lambda.upvalue_count == 0 { - self.emit_constant(Value::Thunk(Thunk::new(lambda)), node); + self.emit_constant(Value::Thunk(Thunk::new(lambda, span)), node); return; } -- cgit 1.4.1