From edd13573f523a3a03346d6737081466bc9c5299d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 12 Dec 2022 23:26:20 +0300 Subject: refactor(tvix/eval): use light spans in builtins.import Change-Id: I05732073155b430575babb6f076bf465aef98857 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7581 Tested-by: BuildkiteCI Reviewed-by: grfn --- tvix/eval/src/vm.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tvix/eval/src/vm.rs') diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs index fcbbe61909..b074bd4224 100644 --- a/tvix/eval/src/vm.rs +++ b/tvix/eval/src/vm.rs @@ -220,17 +220,17 @@ impl<'o> VM<'o> { self.chunk().get_span(self.frame().ip - 1) } - /// Access the I/O handle used for filesystem access in this VM. - pub(crate) fn io(&self) -> &Box { - &self.io_handle - } - /// Returns the information needed to calculate the current span, /// but without performing that calculation. - fn current_light_span(&self) -> LightSpan { + pub(crate) fn current_light_span(&self) -> LightSpan { LightSpan::new_delayed(self.frame().lambda.clone(), self.frame().ip - 1) } + /// Access the I/O handle used for filesystem access in this VM. + pub(crate) fn io(&self) -> &Box { + &self.io_handle + } + /// Construct an error from the given ErrorKind and the source /// span of the current instruction. pub fn error(&self, kind: ErrorKind) -> Error { -- cgit 1.4.1