From a6df2b16df4742a443ba5a0d0f2bf03e3cfb4359 Mon Sep 17 00:00:00 2001 From: Anatol Ulrich Date: Tue, 2 Nov 2021 21:42:17 +0100 Subject: [PATCH] implement Literal::from_str --- crates/proc_macro_srv/src/abis/abi_1_55/rustc_server.rs | 4 ++-- crates/proc_macro_srv/src/abis/abi_1_56/rustc_server.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/proc_macro_srv/src/abis/abi_1_55/rustc_server.rs b/crates/proc_macro_srv/src/abis/abi_1_55/rustc_server.rs index f8626c5f62..6105238d0b 100644 --- a/crates/proc_macro_srv/src/abis/abi_1_55/rustc_server.rs +++ b/crates/proc_macro_srv/src/abis/abi_1_55/rustc_server.rs @@ -488,8 +488,8 @@ impl server::Literal for Rustc { // They must still be present to be ABI-compatible and work with upstream proc_macro. "".to_owned() } - fn from_str(&mut self, _s: &str) -> Result { - unimplemented!() + fn from_str(&mut self, s: &str) -> Result { + Ok(Literal { text: s.into(), id: tt::TokenId::unspecified() }) } fn symbol(&mut self, literal: &Self::Literal) -> String { literal.text.to_string() diff --git a/crates/proc_macro_srv/src/abis/abi_1_56/rustc_server.rs b/crates/proc_macro_srv/src/abis/abi_1_56/rustc_server.rs index fb8a4c8cbe..1cebc289f8 100644 --- a/crates/proc_macro_srv/src/abis/abi_1_56/rustc_server.rs +++ b/crates/proc_macro_srv/src/abis/abi_1_56/rustc_server.rs @@ -489,8 +489,8 @@ impl server::Literal for Rustc { // They must still be present to be ABI-compatible and work with upstream proc_macro. "".to_owned() } - fn from_str(&mut self, _s: &str) -> Result { - unimplemented!() + fn from_str(&mut self, s: &str) -> Result { + Ok(Literal { text: s.into(), id: tt::TokenId::unspecified() }) } fn symbol(&mut self, literal: &Self::Literal) -> String { literal.text.to_string()