diff options
Diffstat (limited to 'crates/proc_macro_api/src/lib.rs')
-rw-r--r-- | crates/proc_macro_api/src/lib.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/crates/proc_macro_api/src/lib.rs b/crates/proc_macro_api/src/lib.rs index d5e87cf7d..0537286dd 100644 --- a/crates/proc_macro_api/src/lib.rs +++ b/crates/proc_macro_api/src/lib.rs | |||
@@ -42,9 +42,17 @@ impl tt::TokenExpander for ProcMacroProcessExpander { | |||
42 | fn expand( | 42 | fn expand( |
43 | &self, | 43 | &self, |
44 | subtree: &Subtree, | 44 | subtree: &Subtree, |
45 | _attr: Option<&Subtree>, | 45 | attr: Option<&Subtree>, |
46 | ) -> Result<Subtree, tt::ExpansionError> { | 46 | ) -> Result<Subtree, tt::ExpansionError> { |
47 | self.process.custom_derive(&self.dylib_path, subtree, &self.name) | 47 | let task = ExpansionTask { |
48 | macro_body: subtree.clone(), | ||
49 | macro_name: self.name.to_string(), | ||
50 | attributes: attr.cloned(), | ||
51 | lib: self.dylib_path.to_path_buf(), | ||
52 | }; | ||
53 | |||
54 | let result: ExpansionResult = self.process.send_task(msg::Request::ExpansionMacro(task))?; | ||
55 | Ok(result.expansion) | ||
48 | } | 56 | } |
49 | } | 57 | } |
50 | 58 | ||