Skip to content

Avoid StringReader when checking code blocks for syntax errors - #76068

Merged
bors merged 1 commit into
rust-lang:masterfrom
matklad:checkcodeblock
Sep 1, 2020
Merged

Avoid StringReader when checking code blocks for syntax errors#76068
bors merged 1 commit into
rust-lang:masterfrom
matklad:checkcodeblock

Conversation

@matklad

Copy link
Copy Markdown
Contributor

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

@matkladmatklad 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
Copy Markdown
ContributorAuthor

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
Copy Markdown
Contributor

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

@matklad

matklad commented Aug 29, 2020

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
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.

@matkladmatklad changed the title WIP: Avoid StringReader when checking code blocks for syntax errorsAvoid StringReader when checking code blocks for syntax errorsAug 29, 2020
@matklad

Copy link
Copy Markdown
ContributorAuthor

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

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

Copy link
Copy Markdown
Member

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

@jyn514jyn514 left a comment

Copy link
Copy Markdown
Member

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.
@matkladmatklad mentioned this pull request Aug 31, 2020
@bors
bors merged commit 1baf3ff into rust-lang:masterSep 1, 2020
@cuvipercuviper added this to the 1.48.0 milestone Nov 17, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-cleanupCategory: PRs that clean code up or issues documenting cleanup.S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties.T-rustdocRelevant 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

@matklad@pickfire@GuillaumeGomez@jyn514@cuviper@bors