about summary refs log tree commit diff
path: root/tvix/eval/src/vm
diff options
context:
space:
mode:
authorRyan Lahfa <tvl@lahfa.xyz>2023-12-30T23·00+0100
committertazjin <tazjin@tvl.su>2024-01-03T13·01+0000
commitd5aa75bbcf5efb13a82330414e26a4a582453552 (patch)
tree499f1b509df7d76c615a843c25ceb20f240ff549 /tvix/eval/src/vm
parent7a84a8fe89e244bf667acc23a6a639fdf977a4e4 (diff)
feat(tvix/eval): emit warnings with kinds and spans r/7310
In the past, we had `emit_warning` be no-op and we used `push_warnings` exclusively
but as we have consumers of this function, we need it to work somewhat.

Change-Id: I78a5ece199a473dec9ef5ea1fae60b36e35137b8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10477
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/eval/src/vm')
-rw-r--r--tvix/eval/src/vm/mod.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/tvix/eval/src/vm/mod.rs b/tvix/eval/src/vm/mod.rs
index 92fa0f00e3d3..febf1cb195ce 100644
--- a/tvix/eval/src/vm/mod.rs
+++ b/tvix/eval/src/vm/mod.rs
@@ -968,13 +968,11 @@ impl<'o> VM<'o> {
 
     /// Emit a warning with the given WarningKind and the source span
     /// of the current instruction.
-    pub fn emit_warning(&mut self, _kind: WarningKind) {
-        // TODO: put LightSpan in warning, calculate only *after* eval
-        // TODO: what to do with the spans?
-        // self.push_warning(EvalWarning {
-        //     kind,
-        //     span: self.current_span(),
-        // });
+    pub fn emit_warning(&mut self, kind: WarningKind) {
+        self.push_warning(EvalWarning {
+            kind,
+            span: self.get_span(),
+        });
     }
 
     /// Interpolate string fragments by popping the specified number of