Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/item_tree/lower.rs')
| -rw-r--r-- | crates/hir-def/src/item_tree/lower.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/crates/hir-def/src/item_tree/lower.rs b/crates/hir-def/src/item_tree/lower.rs index 31c6ef867d..31e409d86e 100644 --- a/crates/hir-def/src/item_tree/lower.rs +++ b/crates/hir-def/src/item_tree/lower.rs @@ -16,7 +16,6 @@ use syntax::{ AstNode, ast::{self, HasModuleItem, HasName}, }; -use triomphe::Arc; use crate::{ db::DefDatabase, @@ -29,20 +28,20 @@ use crate::{ }, }; -pub(super) struct Ctx<'a> { - pub(super) db: &'a dyn DefDatabase, +pub(super) struct Ctx<'db> { + pub(super) db: &'db dyn DefDatabase, tree: ItemTree, - source_ast_id_map: Arc<AstIdMap>, + source_ast_id_map: &'db AstIdMap, span_map: OnceCell<SpanMap>, file: HirFileId, - cfg_options: OnceCell<&'a CfgOptions>, + cfg_options: OnceCell<&'db CfgOptions>, krate: Crate, top_level: Vec<ModItemId>, visibilities: FxIndexSet<RawVisibility>, } -impl<'a> Ctx<'a> { - pub(super) fn new(db: &'a dyn DefDatabase, file: HirFileId, krate: Crate) -> Self { +impl<'db> Ctx<'db> { + pub(super) fn new(db: &'db dyn DefDatabase, file: HirFileId, krate: Crate) -> Self { Self { db, tree: ItemTree::default(), @@ -57,7 +56,7 @@ impl<'a> Ctx<'a> { } #[inline] - pub(super) fn cfg_options(&self) -> &'a CfgOptions { + pub(super) fn cfg_options(&self) -> &'db CfgOptions { self.cfg_options.get_or_init(|| self.krate.cfg_options(self.db)) } |