From c785b7c0c6cd8b3b1cc15eb79caf982a757020ba Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 6 Dec 2020 23:55:21 +0000 Subject: Thread cx through normalization --- dhall/src/ctxt.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dhall/src/ctxt.rs') diff --git a/dhall/src/ctxt.rs b/dhall/src/ctxt.rs index 37fab35..a171ebe 100644 --- a/dhall/src/ctxt.rs +++ b/dhall/src/ctxt.rs @@ -23,7 +23,7 @@ pub struct StoredImport<'cx> { #[derive(Default)] pub struct CtxtS<'cx> { imports: FrozenVec>>, - import_results: FrozenVec>, + import_results: FrozenVec>>, } /// Context for the dhall compiler. Stores various global maps. @@ -58,7 +58,7 @@ impl<'cx> Ctxt<'cx> { ImportId(id) } /// Store the result of fetching an import. - pub fn push_import_result(self, res: Typed) -> ImportResultId { + pub fn push_import_result(self, res: Typed<'cx>) -> ImportResultId { let id = self.0.import_results.len(); self.0.import_results.push(Box::new(res)); ImportResultId(id) @@ -77,12 +77,12 @@ impl<'cx> StoredImport<'cx> { } /// Get the result of fetching this import. Returns `None` if the result has not yet been /// fetched. - pub fn get_result(&self) -> Option<&'cx Typed> { + pub fn get_result(&self) -> Option<&'cx Typed<'cx>> { let res = self.get_resultid()?; Some(&self.cx[res]) } /// Store the result of fetching this import. - pub fn set_result(&self, res: Typed) -> ImportResultId { + pub fn set_result(&self, res: Typed<'cx>) -> ImportResultId { let res = self.cx.push_import_result(res); self.set_resultid(res); res @@ -103,8 +103,8 @@ impl<'cx> std::ops::Index for CtxtS<'cx> { } } impl<'cx> std::ops::Index for CtxtS<'cx> { - type Output = Typed; - fn index(&self, id: ImportResultId) -> &Typed { + type Output = Typed<'cx>; + fn index(&self, id: ImportResultId) -> &Typed<'cx> { &self.import_results[id.0] } } -- cgit v1.2.3