Skip to content

Commit

Permalink
save-analysis: don't choke on stripped doc attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
nrc committed Nov 8, 2016
1 parent 57f971b commit 4b20221
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustc_save_analysis/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,11 @@ fn docs_for_attrs(attrs: &[Attribute]) -> String {
for attr in attrs {
if attr.name() == doc {
if let Some(ref val) = attr.value_str() {
result.push_str(&strip_doc_comment_decoration(val));
if attr.node.is_sugared_doc {
result.push_str(&strip_doc_comment_decoration(val));
} else {
result.push_str(val);
}
result.push('\n');
}
}
Expand Down

0 comments on commit 4b20221

Please sign in to comment.