File tree 2 files changed +24
-1
lines changed
2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ fn doc_comment_text(comment: &ast::Comment) -> SmolStr {
213
213
214
214
// Quote the string
215
215
// Note that `tt::Literal` expect an escaped string
216
- let text = format ! ( "{:?}" , text. escape_default ( ) . to_string( ) ) ;
216
+ let text = format ! ( "{:?}" , text. escape_debug ( ) . to_string( ) ) ;
217
217
text. into ( )
218
218
}
219
219
Original file line number Diff line number Diff line change @@ -969,6 +969,29 @@ fn test_meta_doc_comments() {
969
969
) ;
970
970
}
971
971
972
+ #[ test]
973
+ fn test_meta_doc_comments_non_latin ( ) {
974
+ parse_macro (
975
+ r#"
976
+ macro_rules! foo {
977
+ ($(#[$ i:meta])+) => (
978
+ $(#[$ i])+
979
+ fn bar() {}
980
+ )
981
+ }
982
+ "# ,
983
+ ) .
984
+ assert_expand_items (
985
+ r#"foo! {
986
+ /// 錦瑟無端五十弦,一弦一柱思華年。
987
+ /**
988
+ 莊生曉夢迷蝴蝶,望帝春心託杜鵑。
989
+ */
990
+ }"# ,
991
+ "# [doc = \" 錦瑟無端五十弦,一弦一柱思華年。\" ] # [doc = \" \\ \\ n 莊生曉夢迷蝴蝶,望帝春心託杜鵑。\\ \\ n \" ] fn bar () {}" ,
992
+ ) ;
993
+ }
994
+
972
995
#[ test]
973
996
fn test_tt_block ( ) {
974
997
parse_macro (
You can’t perform that action at this time.
0 commit comments