aboutsummaryrefslogtreecommitdiff
path: root/crates/proc_macro_srv/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/proc_macro_srv/src')
-rw-r--r--crates/proc_macro_srv/src/lib.rs3
-rw-r--r--crates/proc_macro_srv/src/rustc_server.rs3
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/proc_macro_srv/src/lib.rs b/crates/proc_macro_srv/src/lib.rs
index 6e890f8e2..9cca96994 100644
--- a/crates/proc_macro_srv/src/lib.rs
+++ b/crates/proc_macro_srv/src/lib.rs
@@ -40,7 +40,8 @@ impl ProcMacroSrv {
40 match expander.expand(&task.macro_name, &task.macro_body, task.attributes.as_ref()) { 40 match expander.expand(&task.macro_name, &task.macro_body, task.attributes.as_ref()) {
41 Ok(expansion) => Ok(ExpansionResult { expansion }), 41 Ok(expansion) => Ok(ExpansionResult { expansion }),
42 Err(msg) => { 42 Err(msg) => {
43 Err(format!("Cannot perform expansion for {}: error {:?}", &task.macro_name, msg)) 43 let msg = msg.as_str().unwrap_or("<unknown error>");
44 Err(format!("proc-macro panicked: {}", msg))
44 } 45 }
45 } 46 }
46 } 47 }
diff --git a/crates/proc_macro_srv/src/rustc_server.rs b/crates/proc_macro_srv/src/rustc_server.rs
index c5fe3591e..503f4c101 100644
--- a/crates/proc_macro_srv/src/rustc_server.rs
+++ b/crates/proc_macro_srv/src/rustc_server.rs
@@ -184,8 +184,7 @@ pub mod token_stream {
184 let (subtree, _token_map) = 184 let (subtree, _token_map) =
185 mbe::parse_to_token_tree(src).ok_or("Failed to parse from mbe")?; 185 mbe::parse_to_token_tree(src).ok_or("Failed to parse from mbe")?;
186 186
187 let tt: tt::TokenTree = subtree.into(); 187 Ok(TokenStream { subtree })
188 Ok(tt.into())
189 } 188 }
190 } 189 }
191 190