-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Refactor doc comment parsing #74209
Refactor doc comment parsing #74209
Conversation
May need a crater run for rustdoc. |
Actually, this PR needs compiler members review: r? @petrochenkov |
Oh, this looks like something from my todo list. |
That seems right thing to do. How would I proceed this PR? |
bc66a36
to
d087398
Compare
(I didn't look at the PR in detail yet, will review later.) |
19cfcb7
to
b64a104
Compare
src/librustc_ast/util/comments.rs
Outdated
// first line of all-stars should be omitted | ||
if !lines.is_empty() && lines[0].chars().all(|c| c == '*') { | ||
i += 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition may seem useless as we never consider /****** [...] */
as doc comment.
I am not sure about /*!******** [..] */
, should we keep this behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was supposed to address the /******
case.
If it's not relevant now, then it's better to simplify the code and remove it.
36b83df
to
7ff5e2a
Compare
7ff5e2a
to
0dc065a
Compare
This comment has been minimized.
This comment has been minimized.
I'll submit a PR removing the doc comment beautification from the compiler tomorrow. |
Otherwise:
|
Blocked on #74627. |
#74627 has landed. |
0bf2c68
to
2ebd42e
Compare
I still feel skeptical about many changes here (#74209 (comment)). |
Some explanation:
I find the logic straight-forward after rewriting I admit the clippy changes are out of nowhere. Will move it to another PR.
Yeah, I admit |
☔ The latest upstream changes (presumably #75642) made this pull request unmergeable. Please resolve the merge conflicts. |
2ebd42e
to
51d53e6
Compare
51d53e6
to
92521d1
Compare
@lzutao Ping from triage! CI is still red here. Any updates? |
Sorry, I lost interested in this change. Everyone else could pick it if they want. |
Split from #74094 and improved.
I have another way to implement
is_doc_comment
but might be slower: #74183