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

pprust: adjust mixed comment printing and add regression test for #74745 #74980

Merged
merged 3 commits into from
Aug 2, 2020

Conversation

davidtwco
Copy link
Member

Fixes #74745.

This PR adds a regression test for #74745. While a ignore-tidy-trailing-lines header is required, this doesn't stop the test from reproducing, so long as there is no newline at the end of the file.

However, adding the header comments made the test fail due to a bug in pprust - so this PR also adjusts the pretty printing of mixed comments so that the initial zero-break isn't emitted at the beginning of the line. Through this, the block-comment-wchar test can have the pp-exact file removed, as it no longer converges from pretty printing of the source.

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 31, 2020
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 2, 2020
This commit adjusts the pretty printing of mixed comments so that the
initial zero-break isn't emitted at the beginning of the line. Through
this, the `block-comment-wchar` test can have the `pp-exact` file
removed, as it no longer converges from pretty printing of the source.

Signed-off-by: David Wood <david@davidtw.co>
This commit adds a regression test for rust-lang#74745. While a
`ignore-tidy-trailing-lines` header is required, this doesn't stop the
test from reproducing, so long as there is no newline at the end of the
file.

However, adding the header comments made the test fail due to a bug in
pprust, fixed in the previous commit.

Signed-off-by: David Wood <david@davidtw.co>
This commit modifies compiletest so that a diff of actual and expected
output is shown for pretty tests. This makes it far easier to work out
what has changed.

Signed-off-by: David Wood <david@davidtw.co>
@davidtwco davidtwco force-pushed the issue-74745-pprust-regression-test branch from b38ec02 to 1530563 Compare August 2, 2020 15:00
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Aug 2, 2020

📌 Commit 1530563 has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 2, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 2, 2020
…arth

Rollup of 5 pull requests

Successful merges:

 - rust-lang#74980 (pprust: adjust mixed comment printing and add regression test for rust-lang#74745)
 - rust-lang#75009 (Document the discrepancy in the mask type for _mm_shuffle_ps)
 - rust-lang#75031 (Do not trigger `unused_{braces,parens}` lints with `yield`)
 - rust-lang#75059 (fix typos)
 - rust-lang#75064 (compiletest: Support ignoring tests requiring missing LLVM components)

Failed merges:

r? @ghost
@bors bors merged commit bf4a37d into rust-lang:master Aug 2, 2020
@davidtwco davidtwco deleted the issue-74745-pprust-regression-test branch August 3, 2020 09:31
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to pretty format a file ending with a multiline comment without newline
5 participants