aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src/lib.rs
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-05-10 21:54:17 +0100
committerJonas Schievink <[email protected]>2021-05-10 21:54:17 +0100
commit8ea9d939d2c44feb71e2d1c8ec390a9471b75e57 (patch)
tree3c7eff71e1778213524d57f4aee14bfaf9e35a68 /crates/hir_expand/src/lib.rs
parentda08198bc94b9c51338cd94aeadc73324b373011 (diff)
Rewrite `#[derive]` removal to be based on AST
Diffstat (limited to 'crates/hir_expand/src/lib.rs')
-rw-r--r--crates/hir_expand/src/lib.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/crates/hir_expand/src/lib.rs b/crates/hir_expand/src/lib.rs
index 57e08eeb0..5df11856e 100644
--- a/crates/hir_expand/src/lib.rs
+++ b/crates/hir_expand/src/lib.rs
@@ -14,6 +14,7 @@ pub mod builtin_macro;
14pub mod proc_macro; 14pub mod proc_macro;
15pub mod quote; 15pub mod quote;
16pub mod eager; 16pub mod eager;
17mod input;
17 18
18use either::Either; 19use either::Either;
19 20
@@ -292,8 +293,19 @@ pub struct MacroCallLoc {
292 293
293#[derive(Debug, Clone, PartialEq, Eq, Hash)] 294#[derive(Debug, Clone, PartialEq, Eq, Hash)]
294pub enum MacroCallKind { 295pub 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_index: u32 }, 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
299impl MacroCallKind { 311impl MacroCallKind {