1
Fork 0

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
This commit is contained in:
Michael Goulet 2022-12-27 12:33:37 -08:00 committed by GitHub
commit 4de5547aa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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