-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustdoc: consecutive single-line docstrings should be concatenated #3780
Comments
I would be happy to have a look at this (I guess maybe I caused the issue). |
It seems like one way to fix this issue would be to have rustdoc concatenate all doc-attributes/doc-comments for an item and use the concatenated text as if it were from a single doc-attribute/comment. Currently rustdoc discards all but the first doc-attribute, and emits a warning that the others were discarded. However the warning is emitted using warn!(...) which means it doesn't actually display to the user unless they have turned on warn logging for rustdoc, which seems unlikely. Would this approach (concatenating all doc-comments) be ok? |
Another approach would be to change the lexer so that it parses multiple adjacent lines that all start with /// as a single doc-comment. |
@Dretch Having rustdoc concatenate the attributes sounds good to me. |
@Dretch You're right, I ran rustdoc without warnings being logged. |
@peterhull90
Yup. See the pull request - it makes multi-line Unfortunately multi-line comments seem a bit broken in general with rustdoc. In html output mode they are concatenated into a single line (I think due to some weirdness with pandoc). |
Fixed by @Dretch |
… r=flip1995 Fix FP on while-let-on-iterator - fix `is_refutable` for slice patterns - fix `is_refutable` for bindings - add some TODO-s for cases, which can not be fixed easily fixes rust-lang#3780 changelog: fix FP on while-let-on-iterator for arrays and bindings
If document strings for rustdoc are written as a sequence of single line comments (i.e. ///) then rustdoc only uses the first line. The whole sequence should be joined to form a single attribute for further processing.
The text was updated successfully, but these errors were encountered: