Skip to content

Commit 4de5547

Browse files
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 dtolnay/syn#771
2 parents 7f5f31b + ce1e6a4 commit 4de5547

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/doc/rustdoc/src/write-documentation/the-doc-attribute.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ are the same:
99

1010
```rust,no_run
1111
/// This is a doc comment.
12-
#[doc = " This is a doc comment."]
12+
#[doc = r" This is a doc comment."]
1313
# fn f() {}
1414
```
1515

16-
(Note the leading space in the attribute version.)
16+
(Note the leading space and the raw string literal in the attribute version.)
1717

1818
In most cases, `///` is easier to use than `#[doc]`. One case where the latter is easier is
1919
when generating documentation in macros; the `collapse-docs` pass will combine multiple

0 commit comments

Comments
 (0)