File tree 2 files changed +8
-3
lines changed
src/tools/rust-analyzer/crates
proc-macro-srv/src/server_impl
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -507,12 +507,17 @@ mod tests {
507
507
close: span,
508
508
kind: tt:: DelimiterKind :: Brace ,
509
509
} ,
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
+ } ) ) ] ) ,
511
516
} ) ,
512
517
] ,
513
518
} ;
514
519
515
- assert_eq ! ( s. to_string( ) , "struct T {}" ) ;
520
+ assert_eq ! ( s. to_string( ) , "struct T {\" string \" }" ) ;
516
521
}
517
522
518
523
#[ test]
Original file line number Diff line number Diff line change @@ -603,7 +603,7 @@ pub fn pretty<S>(tkns: &[TokenTree<S>]) -> String {
603
603
TokenTree :: Leaf ( Leaf :: Ident ( ident) ) => {
604
604
format ! ( "{}{}" , ident. is_raw. as_str( ) , ident. sym)
605
605
}
606
- TokenTree :: Leaf ( Leaf :: Literal ( literal) ) => literal . symbol . as_str ( ) . to_owned ( ) ,
606
+ TokenTree :: Leaf ( Leaf :: Literal ( literal) ) => format ! ( "{literal}" ) ,
607
607
TokenTree :: Leaf ( Leaf :: Punct ( punct) ) => format ! ( "{}" , punct. char ) ,
608
608
TokenTree :: Subtree ( subtree) => {
609
609
let content = pretty ( & subtree. token_trees ) ;
You can’t perform that action at this time.
0 commit comments