Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 480f555

Browse files
implement literal_from_str (poorly)
1 parent d25b610 commit 480f555

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

crates/proc-macro-srv/src/abis/abi_sysroot/ra_server.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,16 @@ impl server::FreeFunctions for RustAnalyzer {
8080

8181
fn literal_from_str(
8282
&mut self,
83-
_s: &str,
83+
s: &str,
8484
) -> Result<bridge::Literal<Self::Span, Self::Symbol>, ()> {
85-
todo!()
85+
// TODO: keep track of LitKind and Suffix
86+
let symbol = SYMBOL_INTERNER.lock().unwrap().intern(s);
87+
Ok(bridge::Literal {
88+
kind: bridge::LitKind::Err,
89+
symbol,
90+
suffix: None,
91+
span: tt::TokenId::unspecified(),
92+
})
8693
}
8794
}
8895

0 commit comments

Comments
 (0)