aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres/diagnostics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def/src/nameres/diagnostics.rs')
-rw-r--r--crates/hir_def/src/nameres/diagnostics.rs16
1 files changed, 11 insertions, 5 deletions
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 @@
2 2
3use cfg::{CfgExpr, CfgOptions}; 3use cfg::{CfgExpr, CfgOptions};
4use hir_expand::MacroCallKind; 4use hir_expand::MacroCallKind;
5use la_arena::Idx;
5use syntax::ast; 6use syntax::ast;
6 7
7use crate::{nameres::LocalModuleId, path::ModPath, AstId}; 8use crate::{
9 item_tree::{self, ItemTreeId},
10 nameres::LocalModuleId,
11 path::ModPath,
12 AstId,
13};
8 14
9#[derive(Debug, PartialEq, Eq)] 15#[derive(Debug, PartialEq, Eq)]
10pub enum DefDiagnosticKind { 16pub enum DefDiagnosticKind {
@@ -12,7 +18,7 @@ pub enum DefDiagnosticKind {
12 18
13 UnresolvedExternCrate { ast: AstId<ast::ExternCrate> }, 19 UnresolvedExternCrate { ast: AstId<ast::ExternCrate> },
14 20
15 UnresolvedImport { ast: AstId<ast::Use>, index: usize }, 21 UnresolvedImport { id: ItemTreeId<item_tree::Import>, index: Idx<ast::UseTree> },
16 22
17 UnconfiguredCode { ast: AstId<ast::Item>, cfg: CfgExpr, opts: CfgOptions }, 23 UnconfiguredCode { ast: AstId<ast::Item>, cfg: CfgExpr, opts: CfgOptions },
18 24
@@ -53,10 +59,10 @@ impl DefDiagnostic {
53 59
54 pub(super) fn unresolved_import( 60 pub(super) fn unresolved_import(
55 container: LocalModuleId, 61 container: LocalModuleId,
56 ast: AstId<ast::Use>, 62 id: ItemTreeId<item_tree::Import>,
57 index: usize, 63 index: Idx<ast::UseTree>,
58 ) -> Self { 64 ) -> Self {
59 Self { in_module: container, kind: DefDiagnosticKind::UnresolvedImport { ast, index } } 65 Self { in_module: container, kind: DefDiagnosticKind::UnresolvedImport { id, index } }
60 } 66 }
61 67
62 pub(super) fn unconfigured_code( 68 pub(super) fn unconfigured_code(