aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-11-26 16:29:09 +0000
committerJonas Schievink <[email protected]>2020-11-26 16:29:09 +0000
commit519d870c11a9200bdcc33bb788fb7d8a85e5f1e5 (patch)
tree41593247bcff0f60adf669dd0c2da0ec53ae80b4 /crates/hir_def/src/nameres
parent74cb3e96a5279b4df6409ca4c20aac00d2ba5bfd (diff)
Don't store `SyntaxNodePtr` in `CrateDefMap`
It is volatile across reparses and makes incrementality worse.
Diffstat (limited to 'crates/hir_def/src/nameres')
-rw-r--r--crates/hir_def/src/nameres/collector.rs6
1 files changed, 2 insertions, 4 deletions
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<'_, '_> {
1336 1336
1337 fn emit_unconfigured_diagnostic(&mut self, item: ModItem, cfg: &CfgExpr) { 1337 fn emit_unconfigured_diagnostic(&mut self, item: ModItem, cfg: &CfgExpr) {
1338 let ast_id = item.ast_id(self.item_tree); 1338 let ast_id = item.ast_id(self.item_tree);
1339 let id_map = self.def_collector.db.ast_id_map(self.file_id);
1340 let syntax_ptr = id_map.get(ast_id).syntax_node_ptr();
1341 1339
1342 let ast_node = InFile::new(self.file_id, syntax_ptr); 1340 let ast_id = InFile::new(self.file_id, ast_id);
1343 self.def_collector.def_map.diagnostics.push(DefDiagnostic::unconfigured_code( 1341 self.def_collector.def_map.diagnostics.push(DefDiagnostic::unconfigured_code(
1344 self.module_id, 1342 self.module_id,
1345 ast_node, 1343 ast_id,
1346 cfg.clone(), 1344 cfg.clone(),
1347 self.def_collector.cfg_options.clone(), 1345 self.def_collector.cfg_options.clone(),
1348 )); 1346 ));