From 0e5baae7ad16ca2a5a70ba34d922cabcaa68d45e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 18 Sep 2022 02:52:23 +0300 Subject: refactor(tvix/eval): clone the Arc for the compiler This disconnects ownership of the `File` reference in a compiler from the calling scope, which is required for when we implement `import`. `import` will need to carry an `Rc>` (or maybe, in the future, Arc) to give us the ability to add new detected code files at runtime. Note that the choice of `Arc` over `Rc` here is not ours - it's the codemap crate's. Change-Id: I3aeca4ffc167acbd1701846a332d93550b56ba7d Reviewed-on: https://cl.tvl.fyi/c/depot/+/6630 Tested-by: BuildkiteCI Reviewed-by: grfn --- tvix/eval/src/compiler/spans.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tvix/eval/src/compiler/spans.rs') diff --git a/tvix/eval/src/compiler/spans.rs b/tvix/eval/src/compiler/spans.rs index a972a17edd..6c11961e0e 100644 --- a/tvix/eval/src/compiler/spans.rs +++ b/tvix/eval/src/compiler/spans.rs @@ -77,8 +77,8 @@ expr_to_span!(ast::Str); expr_to_span!(ast::UnaryOp); expr_to_span!(ast::With); -impl Compiler<'_, '_> { +impl Compiler<'_> { pub(super) fn span_for(&self, to_span: &S) -> Span { - to_span.span_for(self.file) + to_span.span_for(&self.file) } } -- cgit 1.4.1