From 3c522217b7445c6df9e170d830f485086ad7e062 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 7 Dec 2020 13:47:21 +0000 Subject: Tag cx ids with the cx lifetime To make sure we don't let ids escape and we don't mix scopes. --- dhall/src/semantics/resolve/env.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dhall/src/semantics/resolve/env.rs') diff --git a/dhall/src/semantics/resolve/env.rs b/dhall/src/semantics/resolve/env.rs index 2b998f8..ba6205f 100644 --- a/dhall/src/semantics/resolve/env.rs +++ b/dhall/src/semantics/resolve/env.rs @@ -17,7 +17,7 @@ pub type CyclesStack = Vec; pub struct ImportEnv<'cx> { cx: Ctxt<'cx>, disk_cache: Option, // `None` if it failed to initialize - mem_cache: HashMap, + mem_cache: HashMap>, stack: CyclesStack, } @@ -82,7 +82,7 @@ impl<'cx> ImportEnv<'cx> { pub fn get_from_mem_cache( &self, location: &ImportLocation, - ) -> Option { + ) -> Option> { Some(*self.mem_cache.get(location)?) } @@ -98,7 +98,7 @@ impl<'cx> ImportEnv<'cx> { pub fn write_to_mem_cache( &mut self, location: ImportLocation, - result: ImportResultId, + result: ImportResultId<'cx>, ) { self.mem_cache.insert(location, result); } -- cgit v1.2.3