-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Move doc comment parsing to rustc_lexer #75642
Conversation
r=me with nits addressed. |
960ef2b
to
9ac79cf
Compare
I've addressed nits except for qualified paths. I think, in this case, qualified paths would be better. We have parallel hierarchies of types here:
So, it seems better if we stick to not qualifying |
This looks pretty bad. |
Block vs Line looks like a "heavier" candidate for The other can be Also |
Plain comments are trivial, while doc comments are not, so it feels like this belongs to the rustc_lexer. The specific reason to do this is the desire to use rustc_lexer in rustdoc for syntax highlighting, without duplicating "is this a doc comment?" logic there.
Outer `if` is the fast path -- it calls into hyperoptimized memchr. The inner loop is just the simplest code possible -- it doesn't generated the tightest code, but that shouldn't matter if we are going to error anyhow.
9ac79cf
to
ccbe94b
Compare
How this version look? I've get rid of |
LGTM. |
📌 Commit ccbe94b has been approved by |
☀️ Test successful - checks-actions, checks-azure |
Plain comments are trivia, while doc comments are not, so it feels
like this belongs to the rustc_lexer.
The specific reason to do this is the desire to use rustc_lexer in
rustdoc for syntax highlighting, without duplicating "is this a doc
comment?" logic there.
r? @ghost