Unnamed repository; edit this file 'description' to name the repository.
implement Literal::from_str
Anatol Ulrich 2021-11-03
parent a3830df · commit a6df2b1
-rw-r--r--crates/proc_macro_srv/src/abis/abi_1_55/rustc_server.rs4
-rw-r--r--crates/proc_macro_srv/src/abis/abi_1_56/rustc_server.rs4
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<Self::Literal, ()> {
- unimplemented!()
+ fn from_str(&mut self, s: &str) -> Result<Self::Literal, ()> {
+ 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<Self::Literal, ()> {
- unimplemented!()
+ fn from_str(&mut self, s: &str) -> Result<Self::Literal, ()> {
+ Ok(Literal { text: s.into(), id: tt::TokenId::unspecified() })
}
fn symbol(&mut self, literal: &Self::Literal) -> String {
literal.text.to_string()