Correctly handle starts in block doc comments

This commit is contained in:
Guillaume Gomez 2022-01-18 16:56:16 +01:00
parent 7531d2fdd4
commit 2938be612d
5 changed files with 47 additions and 15 deletions

View file

@ -821,9 +821,9 @@ impl<'tcx> SaveContext<'tcx> {
let mut result = String::new();
for attr in attrs {
if let Some(val) = attr.doc_str() {
if let Some((val, kind)) = attr.doc_str_and_comment_kind() {
// FIXME: Should save-analysis beautify doc strings itself or leave it to users?
result.push_str(beautify_doc_string(val).as_str());
result.push_str(beautify_doc_string(val, kind).as_str());
result.push('\n');
}
}