diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-25 21:33:21 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-25 21:33:21 +0100 |
commit | 5587d0a3e3599063a8993e9a44a7628abbabae8b (patch) | |
tree | 77d3d645249361e8a4730be803338caccddeefa0 /crates/hir_expand/src/lib.rs | |
parent | e23083f39813f9559c041b295d23534cd2125913 (diff) | |
parent | 5c9f31d4c28478b4373e6cf5ec155745c840ee3f (diff) |
Merge #8973
8973: internal: move diagnostics to hir r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/hir_expand/src/lib.rs')
-rw-r--r-- | crates/hir_expand/src/lib.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/hir_expand/src/lib.rs b/crates/hir_expand/src/lib.rs index 6be4516a3..10d37234e 100644 --- a/crates/hir_expand/src/lib.rs +++ b/crates/hir_expand/src/lib.rs | |||
@@ -8,7 +8,6 @@ pub mod db; | |||
8 | pub mod ast_id_map; | 8 | pub mod ast_id_map; |
9 | pub mod name; | 9 | pub mod name; |
10 | pub mod hygiene; | 10 | pub mod hygiene; |
11 | pub mod diagnostics; | ||
12 | pub mod builtin_derive; | 11 | pub mod builtin_derive; |
13 | pub mod builtin_macro; | 12 | pub mod builtin_macro; |
14 | pub mod proc_macro; | 13 | pub mod proc_macro; |
@@ -108,7 +107,7 @@ impl HirFileId { | |||
108 | HirFileIdRepr::FileId(_) => None, | 107 | HirFileIdRepr::FileId(_) => None, |
109 | HirFileIdRepr::MacroFile(macro_file) => { | 108 | HirFileIdRepr::MacroFile(macro_file) => { |
110 | let loc: MacroCallLoc = db.lookup_intern_macro(macro_file.macro_call_id); | 109 | let loc: MacroCallLoc = db.lookup_intern_macro(macro_file.macro_call_id); |
111 | Some(loc.kind.node(db)) | 110 | Some(loc.kind.to_node(db)) |
112 | } | 111 | } |
113 | } | 112 | } |
114 | } | 113 | } |
@@ -153,7 +152,7 @@ impl HirFileId { | |||
153 | HirFileIdRepr::MacroFile(macro_file) => { | 152 | HirFileIdRepr::MacroFile(macro_file) => { |
154 | let loc: MacroCallLoc = db.lookup_intern_macro(macro_file.macro_call_id); | 153 | let loc: MacroCallLoc = db.lookup_intern_macro(macro_file.macro_call_id); |
155 | let item = match loc.def.kind { | 154 | let item = match loc.def.kind { |
156 | MacroDefKind::BuiltInDerive(..) => loc.kind.node(db), | 155 | MacroDefKind::BuiltInDerive(..) => loc.kind.to_node(db), |
157 | _ => return None, | 156 | _ => return None, |
158 | }; | 157 | }; |
159 | Some(item.with_value(ast::Item::cast(item.value.clone())?)) | 158 | Some(item.with_value(ast::Item::cast(item.value.clone())?)) |
@@ -269,7 +268,7 @@ impl MacroCallKind { | |||
269 | } | 268 | } |
270 | } | 269 | } |
271 | 270 | ||
272 | fn node(&self, db: &dyn db::AstDatabase) -> InFile<SyntaxNode> { | 271 | pub fn to_node(&self, db: &dyn db::AstDatabase) -> InFile<SyntaxNode> { |
273 | match self { | 272 | match self { |
274 | MacroCallKind::FnLike { ast_id, .. } => { | 273 | MacroCallKind::FnLike { ast_id, .. } => { |
275 | ast_id.with_value(ast_id.to_node(db).syntax().clone()) | 274 | ast_id.with_value(ast_id.to_node(db).syntax().clone()) |