Rollup merge of #37644 - nrc:save-derive-span, r=eddyb

save-analysis: don't choke on stripped doc attributes
This commit is contained in:
Eduard-Mihai Burtescu 2016-11-09 20:51:19 +02:00 committed by GitHub
commit a41a87eb74

View File

@ -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');
}
}