From 2c245e7f5ce4019381e0fa47a1e2caf6276106be Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 1 Nov 2020 15:17:42 +0000 Subject: Store file cache in ImportEnv --- dhall/src/semantics/resolve/cache.rs | 2 +- dhall/src/semantics/resolve/env.rs | 23 ++++++++++++++--------- dhall/src/semantics/resolve/resolve.rs | 14 +++++--------- 3 files changed, 20 insertions(+), 19 deletions(-) (limited to 'dhall/src/semantics/resolve') diff --git a/dhall/src/semantics/resolve/cache.rs b/dhall/src/semantics/resolve/cache.rs index 164baea..dd686ea 100644 --- a/dhall/src/semantics/resolve/cache.rs +++ b/dhall/src/semantics/resolve/cache.rs @@ -40,7 +40,7 @@ fn load_cache_dir( Err(CacheError::MissingConfiguration) } -#[derive(Debug, PartialEq)] +#[derive(Debug, Clone, PartialEq)] pub struct Cache { cache_dir: Option, } diff --git a/dhall/src/semantics/resolve/env.rs b/dhall/src/semantics/resolve/env.rs index 25d2277..4d502ce 100644 --- a/dhall/src/semantics/resolve/env.rs +++ b/dhall/src/semantics/resolve/env.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; use crate::error::{Error, ImportError}; -use crate::semantics::{AlphaVar, ImportLocation, TypedHir, VarEnv}; +use crate::semantics::{AlphaVar, Cache, ImportLocation, TypedHir, VarEnv}; use crate::syntax::{Label, V}; /// Environment for resolving names. @@ -10,14 +10,15 @@ pub struct NameEnv { names: Vec