From b52df9187730abbcd9cbb132f7d184c74b9a3b7f Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Wed, 26 May 2021 01:01:58 +0200 Subject: Stop expanding UseTrees during ItemTree lowering --- crates/hir_def/src/nameres/diagnostics.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'crates/hir_def/src/nameres/diagnostics.rs') diff --git a/crates/hir_def/src/nameres/diagnostics.rs b/crates/hir_def/src/nameres/diagnostics.rs index 8f2f0ff9f..57c36c3c6 100644 --- a/crates/hir_def/src/nameres/diagnostics.rs +++ b/crates/hir_def/src/nameres/diagnostics.rs @@ -2,9 +2,15 @@ use cfg::{CfgExpr, CfgOptions}; use hir_expand::MacroCallKind; +use la_arena::Idx; use syntax::ast; -use crate::{nameres::LocalModuleId, path::ModPath, AstId}; +use crate::{ + item_tree::{self, ItemTreeId}, + nameres::LocalModuleId, + path::ModPath, + AstId, +}; #[derive(Debug, PartialEq, Eq)] pub enum DefDiagnosticKind { @@ -12,7 +18,7 @@ pub enum DefDiagnosticKind { UnresolvedExternCrate { ast: AstId }, - UnresolvedImport { ast: AstId, index: usize }, + UnresolvedImport { id: ItemTreeId, index: Idx }, UnconfiguredCode { ast: AstId, cfg: CfgExpr, opts: CfgOptions }, @@ -53,10 +59,10 @@ impl DefDiagnostic { pub(super) fn unresolved_import( container: LocalModuleId, - ast: AstId, - index: usize, + id: ItemTreeId, + index: Idx, ) -> Self { - Self { in_module: container, kind: DefDiagnosticKind::UnresolvedImport { ast, index } } + Self { in_module: container, kind: DefDiagnosticKind::UnresolvedImport { id, index } } } pub(super) fn unconfigured_code( -- cgit v1.2.3