From 519d870c11a9200bdcc33bb788fb7d8a85e5f1e5 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Thu, 26 Nov 2020 17:29:09 +0100 Subject: Don't store `SyntaxNodePtr` in `CrateDefMap` It is volatile across reparses and makes incrementality worse. --- crates/hir_def/src/nameres/collector.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'crates/hir_def/src/nameres') diff --git a/crates/hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs index 386287518..5ed9073e0 100644 --- a/crates/hir_def/src/nameres/collector.rs +++ b/crates/hir_def/src/nameres/collector.rs @@ -1336,13 +1336,11 @@ impl ModCollector<'_, '_> { fn emit_unconfigured_diagnostic(&mut self, item: ModItem, cfg: &CfgExpr) { let ast_id = item.ast_id(self.item_tree); - let id_map = self.def_collector.db.ast_id_map(self.file_id); - let syntax_ptr = id_map.get(ast_id).syntax_node_ptr(); - let ast_node = InFile::new(self.file_id, syntax_ptr); + let ast_id = InFile::new(self.file_id, ast_id); self.def_collector.def_map.diagnostics.push(DefDiagnostic::unconfigured_code( self.module_id, - ast_node, + ast_id, cfg.clone(), self.def_collector.cfg_options.clone(), )); -- cgit v1.2.3