diff options
Diffstat (limited to 'tvix')
-rw-r--r-- | tvix/eval/src/spans.rs | 12 | ||||
-rw-r--r-- | tvix/eval/src/vm/mod.rs | 2 |
2 files changed, 1 insertions, 13 deletions
diff --git a/tvix/eval/src/spans.rs b/tvix/eval/src/spans.rs index c0130a665428..f422093b0d12 100644 --- a/tvix/eval/src/spans.rs +++ b/tvix/eval/src/spans.rs @@ -1,12 +1,9 @@ //! Utilities for dealing with span tracking in the compiler and in //! error reporting. -use crate::opcode::CodeIdx; -use crate::value::Lambda; use codemap::{File, Span}; use rnix::ast; use rowan::ast::AstNode; -use std::rc::Rc; /// Helper struct to carry information required for making a span, but /// without actually performing the (expensive) span lookup. @@ -19,17 +16,9 @@ pub enum LightSpan { /// The span has already been computed and can just be used right /// away. Actual { span: Span }, - - /// The span needs to be computed from the provided data, but only - /// when it is required. - Delayed { lambda: Rc<Lambda>, offset: CodeIdx }, } impl LightSpan { - pub fn new_delayed(lambda: Rc<Lambda>, offset: CodeIdx) -> Self { - Self::Delayed { lambda, offset } - } - pub fn new_actual(span: Span) -> Self { Self::Actual { span } } @@ -37,7 +26,6 @@ impl LightSpan { pub fn span(&self) -> Span { match self { LightSpan::Actual { span } => *span, - LightSpan::Delayed { lambda, offset } => lambda.chunk.get_span(*offset), } } } diff --git a/tvix/eval/src/vm/mod.rs b/tvix/eval/src/vm/mod.rs index 99a913c46ac9..e11b3b5d13c4 100644 --- a/tvix/eval/src/vm/mod.rs +++ b/tvix/eval/src/vm/mod.rs @@ -161,7 +161,7 @@ impl CallFrame { /// but without performing that calculation. // TODO: why pub? pub(crate) fn current_light_span(&self) -> LightSpan { - LightSpan::new_delayed(self.lambda.clone(), self.ip - 1) + LightSpan::new_actual(self.current_span()) } } |