]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_save_analysis/lib.rs
Rollup merge of #37644 - nrc:save-derive-span, r=eddyb
[rust.git] / src / librustc_save_analysis / lib.rs
index 9103b90d7d22168d43b99277108b49af6075c1b0..e1b67d211a33328396c052798f6e8623e7bb2b82 100644 (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');
             }
         }