Skip to content

Commit a6df2b1

Browse files
author
Anatol Ulrich
committed
implement Literal::from_str
1 parent a3830df commit a6df2b1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/proc_macro_srv/src/abis/abi_1_55/rustc_server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,8 @@ impl server::Literal for Rustc {
488488
// They must still be present to be ABI-compatible and work with upstream proc_macro.
489489
"".to_owned()
490490
}
491-
fn from_str(&mut self, _s: &str) -> Result<Self::Literal, ()> {
492-
unimplemented!()
491+
fn from_str(&mut self, s: &str) -> Result<Self::Literal, ()> {
492+
Ok(Literal { text: s.into(), id: tt::TokenId::unspecified() })
493493
}
494494
fn symbol(&mut self, literal: &Self::Literal) -> String {
495495
literal.text.to_string()

crates/proc_macro_srv/src/abis/abi_1_56/rustc_server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,8 @@ impl server::Literal for Rustc {
489489
// They must still be present to be ABI-compatible and work with upstream proc_macro.
490490
"".to_owned()
491491
}
492-
fn from_str(&mut self, _s: &str) -> Result<Self::Literal, ()> {
493-
unimplemented!()
492+
fn from_str(&mut self, s: &str) -> Result<Self::Literal, ()> {
493+
Ok(Literal { text: s.into(), id: tt::TokenId::unspecified() })
494494
}
495495
fn symbol(&mut self, literal: &Self::Literal) -> String {
496496
literal.text.to_string()

0 commit comments

Comments
 (0)