]> git.proxmox.com Git - rustc.git/blobdiff - src/doc/rustdoc/src/write-documentation/the-doc-attribute.md
New upstream version 1.68.2+dfsg1
[rustc.git] / src / doc / rustdoc / src / write-documentation / the-doc-attribute.md
index e3b08648999804da3d1bf78ef7373b36f14b2ac2..8ecf05f0e121f7316fc9301b59f5227239f0436a 100644 (file)
@@ -9,11 +9,11 @@ are the same:
 
 ```rust,no_run
 /// This is a doc comment.
-#[doc = " This is a doc comment."]
+#[doc = r" This is a doc comment."]
 # fn f() {}
 ```
 
-(Note the leading space in the attribute version.)
+(Note the leading space and the raw string literal in the attribute version.)
 
 In most cases, `///` is easier to use than `#[doc]`. One case where the latter is easier is
 when generating documentation in macros; the `collapse-docs` pass will combine multiple