diff options
Diffstat (limited to 'crates/hir_expand/src/lib.rs')
-rw-r--r-- | crates/hir_expand/src/lib.rs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/crates/hir_expand/src/lib.rs b/crates/hir_expand/src/lib.rs index 80ab3aeee..5df11856e 100644 --- a/crates/hir_expand/src/lib.rs +++ b/crates/hir_expand/src/lib.rs | |||
@@ -14,6 +14,7 @@ pub mod builtin_macro; | |||
14 | pub mod proc_macro; | 14 | pub mod proc_macro; |
15 | pub mod quote; | 15 | pub mod quote; |
16 | pub mod eager; | 16 | pub mod eager; |
17 | mod input; | ||
17 | 18 | ||
18 | use either::Either; | 19 | use either::Either; |
19 | 20 | ||
@@ -292,13 +293,21 @@ pub struct MacroCallLoc { | |||
292 | 293 | ||
293 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 294 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
294 | pub enum MacroCallKind { | 295 | pub enum MacroCallKind { |
295 | FnLike { ast_id: AstId<ast::MacroCall>, fragment: FragmentKind }, | 296 | FnLike { |
296 | Derive { ast_id: AstId<ast::Item>, derive_name: String, derive_attr: AttrId }, | 297 | ast_id: AstId<ast::MacroCall>, |
298 | fragment: FragmentKind, | ||
299 | }, | ||
300 | Derive { | ||
301 | ast_id: AstId<ast::Item>, | ||
302 | derive_name: String, | ||
303 | /// Syntactical index of the invoking `#[derive]` attribute. | ||
304 | /// | ||
305 | /// Outer attributes are counted first, then inner attributes. This does not support | ||
306 | /// out-of-line modules, which may have attributes spread across 2 files! | ||
307 | derive_attr_index: u32, | ||
308 | }, | ||
297 | } | 309 | } |
298 | 310 | ||
299 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | ||
300 | pub struct AttrId(pub u32); | ||
301 | |||
302 | impl MacroCallKind { | 311 | impl MacroCallKind { |
303 | fn file_id(&self) -> HirFileId { | 312 | fn file_id(&self) -> HirFileId { |
304 | match self { | 313 | match self { |