summaryrefslogtreecommitdiff
path: root/src/codegen/helpers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen/helpers.rs')
-rw-r--r--src/codegen/helpers.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/codegen/helpers.rs b/src/codegen/helpers.rs
index a73f02ae..f1007c51 100644
--- a/src/codegen/helpers.rs
+++ b/src/codegen/helpers.rs
@@ -38,7 +38,14 @@ pub mod attributes {
}
pub fn doc(comment: String) -> quote::Tokens {
- quote!(#[doc=#comment])
+ // Doc comments are already preprocessed into nice `///` formats by the
+ // time they get here. Just make sure that we have newlines around it so
+ // that nothing else gets wrapped into the comment.
+ let mut tokens = quote! {};
+ tokens.append(Term::new("\n", Span::call_site()));
+ tokens.append(Term::new(&comment, Span::call_site()));
+ tokens.append(Term::new("\n", Span::call_site()));
+ tokens
}
pub fn link_name(name: &str) -> quote::Tokens {