about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-12-27 12:33:37 -0800
committerGitHub <noreply@github.com>2022-12-27 12:33:37 -0800
commit4de5547aa02d67ff7c2b723a21fd69b17e01ed6d (patch)
treeed8e4bc38d09bd05b0cb0f655260a8a1090b7c11
parent7f5f31bc376943c0f6085f714f6745423bae0ade (diff)
parentce1e6a46129eb16ca3339c9cc4f71f9beb68ea5e (diff)
downloadrust-4de5547aa02d67ff7c2b723a21fd69b17e01ed6d.tar.gz
rust-4de5547aa02d67ff7c2b723a21fd69b17e01ed6d.zip
Rollup merge of #106181 - kraktus:fix_doc_parsing, r=notriddle
Fix doc comment parsing description in book

This can actually make a difference for the user if they rely on unicode formating.

Prompted by https://github.com/dtolnay/syn/issues/771
-rw-r--r--src/doc/rustdoc/src/write-documentation/the-doc-attribute.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/doc/rustdoc/src/write-documentation/the-doc-attribute.md b/src/doc/rustdoc/src/write-documentation/the-doc-attribute.md
index e3b08648999..8ecf05f0e12 100644
--- a/src/doc/rustdoc/src/write-documentation/the-doc-attribute.md
+++ b/src/doc/rustdoc/src/write-documentation/the-doc-attribute.md
@@ -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