aboutsummaryrefslogtreecommitdiff
path: root/crates/proc_macro_api/src/process.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/proc_macro_api/src/process.rs')
-rw-r--r--crates/proc_macro_api/src/process.rs20
1 files changed, 1 insertions, 19 deletions
diff --git a/crates/proc_macro_api/src/process.rs b/crates/proc_macro_api/src/process.rs
index 301888a0e..d68723ada 100644
--- a/crates/proc_macro_api/src/process.rs
+++ b/crates/proc_macro_api/src/process.rs
@@ -10,11 +10,10 @@ use std::{
10}; 10};
11 11
12use crossbeam_channel::{bounded, Receiver, Sender}; 12use crossbeam_channel::{bounded, Receiver, Sender};
13use tt::Subtree;
14 13
15use crate::{ 14use crate::{
16 msg::{ErrorCode, Message, Request, Response, ResponseError}, 15 msg::{ErrorCode, Message, Request, Response, ResponseError},
17 rpc::{ExpansionResult, ExpansionTask, ListMacrosResult, ListMacrosTask, ProcMacroKind}, 16 rpc::{ListMacrosResult, ListMacrosTask, ProcMacroKind},
18}; 17};
19 18
20#[derive(Debug, Default)] 19#[derive(Debug, Default)]
@@ -58,23 +57,6 @@ impl ProcMacroProcessSrv {
58 Ok(result.macros) 57 Ok(result.macros)
59 } 58 }
60 59
61 pub(crate) fn custom_derive(
62 &self,
63 dylib_path: &Path,
64 subtree: &Subtree,
65 derive_name: &str,
66 ) -> Result<Subtree, tt::ExpansionError> {
67 let task = ExpansionTask {
68 macro_body: subtree.clone(),
69 macro_name: derive_name.to_string(),
70 attributes: None,
71 lib: dylib_path.to_path_buf(),
72 };
73
74 let result: ExpansionResult = self.send_task(Request::ExpansionMacro(task))?;
75 Ok(result.expansion)
76 }
77
78 pub(crate) fn send_task<R>(&self, req: Request) -> Result<R, tt::ExpansionError> 60 pub(crate) fn send_task<R>(&self, req: Request) -> Result<R, tt::ExpansionError>
79 where 61 where
80 R: TryFrom<Response, Error = &'static str>, 62 R: TryFrom<Response, Error = &'static str>,