Skip to content

Commit 4b20221

Browse files
committed
save-analysis: don't choke on stripped doc attributes
1 parent 57f971b commit 4b20221

File tree

1 file changed

+5
-1
lines changed
  • src/librustc_save_analysis

1 file changed

+5
-1
lines changed

src/librustc_save_analysis/lib.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,11 @@ fn docs_for_attrs(attrs: &[Attribute]) -> String {
759759
for attr in attrs {
760760
if attr.name() == doc {
761761
if let Some(ref val) = attr.value_str() {
762-
result.push_str(&strip_doc_comment_decoration(val));
762+
if attr.node.is_sugared_doc {
763+
result.push_str(&strip_doc_comment_decoration(val));
764+
} else {
765+
result.push_str(val);
766+
}
763767
result.push('\n');
764768
}
765769
}

0 commit comments

Comments
 (0)