@@ -83,10 +83,9 @@ impl server::FreeFunctions for RustAnalyzer {
8383 s : & str ,
8484 ) -> Result < bridge:: Literal < Self :: Span , Self :: Symbol > , ( ) > {
8585 // FIXME: keep track of LitKind and Suffix
86- let symbol = ThreadLocalSymbolInterner :: intern ( s) ;
8786 Ok ( bridge:: Literal {
8887 kind : bridge:: LitKind :: Err ,
89- symbol,
88+ symbol : Symbol :: intern ( s ) ,
9089 suffix : None ,
9190 span : tt:: TokenId :: unspecified ( ) ,
9291 } )
@@ -124,7 +123,7 @@ impl server::TokenStream for RustAnalyzer {
124123
125124 bridge:: TokenTree :: Ident ( ident) => {
126125 // FIXME: handle raw idents
127- let text = ThreadLocalSymbolInterner :: get_cloned ( & ident. sym ) ;
126+ let text = ident. sym . text ( ) ;
128127 let ident: tt:: Ident = tt:: Ident { text, id : ident. span } ;
129128 let leaf = tt:: Leaf :: from ( ident) ;
130129 let tree = TokenTree :: from ( leaf) ;
@@ -198,7 +197,7 @@ impl server::TokenStream for RustAnalyzer {
198197 . map ( |tree| match tree {
199198 tt:: TokenTree :: Leaf ( tt:: Leaf :: Ident ( ident) ) => {
200199 bridge:: TokenTree :: Ident ( bridge:: Ident {
201- sym : ThreadLocalSymbolInterner :: intern ( & ident. text ) ,
200+ sym : Symbol :: intern ( & ident. text ) ,
202201 // FIXME: handle raw idents
203202 is_raw : false ,
204203 span : ident. id ,
@@ -208,7 +207,7 @@ impl server::TokenStream for RustAnalyzer {
208207 bridge:: TokenTree :: Literal ( bridge:: Literal {
209208 // FIXME: handle literal kinds
210209 kind : bridge:: LitKind :: Err ,
211- symbol : ThreadLocalSymbolInterner :: intern ( & lit. text ) ,
210+ symbol : Symbol :: intern ( & lit. text ) ,
212211 // FIXME: handle suffixes
213212 suffix : None ,
214213 span : lit. id ,
@@ -402,11 +401,11 @@ impl server::Server for RustAnalyzer {
402401 }
403402
404403 fn intern_symbol ( ident : & str ) -> Self :: Symbol {
405- ThreadLocalSymbolInterner :: intern ( & tt:: SmolStr :: from ( ident) )
404+ Symbol :: intern ( & tt:: SmolStr :: from ( ident) )
406405 }
407406
408407 fn with_symbol_string ( symbol : & Self :: Symbol , f : impl FnOnce ( & str ) ) {
409- ThreadLocalSymbolInterner :: with ( symbol, |s| f ( s . as_str ( ) ) )
408+ f ( symbol. text ( ) . as_str ( ) )
410409 }
411410}
412411
@@ -450,10 +449,9 @@ impl LiteralFormatter {
450449 }
451450
452451 fn with_symbol_and_suffix < R > ( & self , f : impl FnOnce ( & str , & str ) -> R ) -> R {
453- ThreadLocalSymbolInterner :: with ( & self . 0 . symbol , |symbol| match self . 0 . suffix . as_ref ( ) {
454- Some ( suffix) => ThreadLocalSymbolInterner :: with ( suffix, |suffix| f ( symbol, suffix) ) ,
455- None => f ( symbol, "" ) ,
456- } )
452+ let symbol = self . 0 . symbol . text ( ) ;
453+ let suffix = self . 0 . suffix . map ( |s| s. text ( ) ) . unwrap_or_default ( ) ;
454+ f ( symbol. as_str ( ) , suffix. as_str ( ) )
457455 }
458456}
459457
0 commit comments