about summary refs log tree commit diff
diff options
context:
space:
mode:
authorkraktus <kraktus@users.noreply.github.com>2022-12-27 13:31:53 +0100
committerkraktus <kraktus@users.noreply.github.com>2022-12-27 13:31:53 +0100
commitce1e6a46129eb16ca3339c9cc4f71f9beb68ea5e (patch)
treedfe62ff3462dc20d91a30aa0a417281dfa74b1fd
parent0ca50032ce7271ebbe6f4e3f766c686f6204116c (diff)
downloadrust-ce1e6a46129eb16ca3339c9cc4f71f9beb68ea5e.tar.gz
rust-ce1e6a46129eb16ca3339c9cc4f71f9beb68ea5e.zip
Fix doc comment parsing
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