File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
src/tools/rust-analyzer/crates
proc-macro-srv/src/server_impl Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -507,12 +507,17 @@ mod tests {
507507 close: span,
508508 kind: tt:: DelimiterKind :: Brace ,
509509 } ,
510- token_trees: Box :: new( [ ] ) ,
510+ token_trees: Box :: new( [ tt:: TokenTree :: Leaf ( tt:: Leaf :: Literal ( tt:: Literal {
511+ kind: tt:: LitKind :: Str ,
512+ symbol: Symbol :: intern( "string" ) ,
513+ suffix: None ,
514+ span,
515+ } ) ) ] ) ,
511516 } ) ,
512517 ] ,
513518 } ;
514519
515- assert_eq ! ( s. to_string( ) , "struct T {}" ) ;
520+ assert_eq ! ( s. to_string( ) , "struct T {\" string \" }" ) ;
516521 }
517522
518523 #[ test]
Original file line number Diff line number Diff line change @@ -603,7 +603,7 @@ pub fn pretty<S>(tkns: &[TokenTree<S>]) -> String {
603603 TokenTree :: Leaf ( Leaf :: Ident ( ident) ) => {
604604 format ! ( "{}{}" , ident. is_raw. as_str( ) , ident. sym)
605605 }
606- TokenTree :: Leaf ( Leaf :: Literal ( literal) ) => literal . symbol . as_str ( ) . to_owned ( ) ,
606+ TokenTree :: Leaf ( Leaf :: Literal ( literal) ) => format ! ( "{literal}" ) ,
607607 TokenTree :: Leaf ( Leaf :: Punct ( punct) ) => format ! ( "{}" , punct. char ) ,
608608 TokenTree :: Subtree ( subtree) => {
609609 let content = pretty ( & subtree. token_trees ) ;
You can’t perform that action at this time.
0 commit comments