Quote the quoted comment
This commit is contained in:
parent
048f12d9f0
commit
036141663b
@ -135,7 +135,7 @@ fn doc_comment_text(comment: &ast::Comment) -> SmolStr {
|
||||
|
||||
// Quote the string
|
||||
// Note that `tt::Literal` expect an escaped string
|
||||
let text = format!("\"{}\"", text.escape_default());
|
||||
let text = format!("{:?}", text.escape_default().to_string());
|
||||
text.into()
|
||||
}
|
||||
|
||||
|
@ -888,7 +888,7 @@ fn test_meta_doc_comments() {
|
||||
MultiLines Doc
|
||||
*/
|
||||
}"#,
|
||||
"# [doc = \" Single Line Doc 1\"] # [doc = \" \\n MultiLines Doc\\n \"] fn bar () {}",
|
||||
"# [doc = \" Single Line Doc 1\"] # [doc = \" \\\\n MultiLines Doc\\\\n \"] fn bar () {}",
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user