Skip to content
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

Avoid StringReader when checking code blocks for syntax errors #76068

Merged
merged 1 commit into from
Sep 1, 2020

Conversation

matklad
Copy link
Member

@matklad matklad commented Aug 29, 2020

parse_stream_from_source_str is a more stable API to convert a
string into a bunch of tokens, and it also catches errors about
mismatched parenthesis.

r? @ghost

@matklad matklad added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-parselib labels Aug 29, 2020
@matklad
Copy link
Member Author

matklad commented Aug 29, 2020

This fails the bad-code-block.rs test, but I am not sure what the error is.

r? @GuillaumeGomez (but this a WIP due to the test failure)

cc @petrochenkov

@pickfire
Copy link
Contributor

@matklad Are you sure you assigned the correct reviewer? Did you mean @ghost?

@matklad
Copy link
Member Author

matklad commented Aug 29, 2020

Yes: specifying r? @username directly in the PR description leads to ping amplification (as PR description is included in the commit message generated by bors). So I write ghost and then assign the actual reviewer in the second comment.

@pickfire
Copy link
Contributor

Ah, I got confused for a moment. I forgot this is rustdoc and @GuillaumeGomez is a reviewer, I thought you made a typo on the reviewer.

@matklad matklad changed the title WIP: Avoid StringReader when checking code blocks for syntax errors Avoid StringReader when checking code blocks for syntax errors Aug 29, 2020
@matklad
Copy link
Member Author

matklad commented Aug 29, 2020

Fixed the test failure, should be ready to review now!

@matklad matklad added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 29, 2020
@GuillaumeGomez
Copy link
Member

Looks good to me. Since you ping @petrochenkov, I'll let them take a look first as well. cc @jyn514

Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I don't know this part of the code very well but if @matklad says parse_stream_from_source_str is more stable I trust his judgement.

`parse_stream_from_source_str` is a more stable API to convert a
string into a bunch of tokens, and it also catches errors about
mismatched parenthesis.
@bors bors merged commit 1baf3ff into rust-lang:master Sep 1, 2020
@cuviper cuviper added this to the 1.48.0 milestone Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants