diff options
author | Nadrieril | 2020-12-06 23:55:21 +0000 |
---|---|---|
committer | Nadrieril | 2020-12-07 19:34:38 +0000 |
commit | c785b7c0c6cd8b3b1cc15eb79caf982a757020ba (patch) | |
tree | 6d38e68385814073b8b22ee8a8956435546892dc /dhall/src/ctxt.rs | |
parent | 6287b7a7f9e421877ee13fefa586395fec844c99 (diff) |
Thread cx through normalization
Diffstat (limited to 'dhall/src/ctxt.rs')
-rw-r--r-- | dhall/src/ctxt.rs | 12 |
1 files changed, 6 insertions, 6 deletions
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<Box<StoredImport<'cx>>>, - import_results: FrozenVec<Box<Typed>>, + import_results: FrozenVec<Box<Typed<'cx>>>, } /// 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<ImportId> for CtxtS<'cx> { } } impl<'cx> std::ops::Index<ImportResultId> 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] } } |