10680: implement Literal::from_str r=jonas-schievink a=spookyvision

this apparently fixes RTIC 0.6's 
```rust
#[rtic::app]
mod app {}
```

Co-authored-by: Anatol Ulrich <anatol.ulrich@ferrous-systems.com>
This commit is contained in:
bors[bot] 2021-11-03 16:19:42 +00:00 committed by GitHub
commit 9ee855bcc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -488,8 +488,8 @@ fn debug_kind(&mut self, _literal: &Self::Literal) -> String {
// 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()

View File

@ -489,8 +489,8 @@ fn debug_kind(&mut self, _literal: &Self::Literal) -> String {
// 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()