-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Pretty-printer inserts an extra newline after multiline trailing comments #37201
Labels
A-pretty
Area: Pretty printing (including `-Z unpretty`)
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Comments
eddyb
added a commit
to eddyb/rust
that referenced
this issue
Oct 19, 2016
Fix some pretty printing tests Many pretty-printing tests are un-ignored. Some issues in classification of comments (trailing/isolated) and blank line counting are fixed. Some comments are printed more carefully. Some minor refactoring in pprust.rs `no-pretty-expanded` annotations are removed because this is the default now. `pretty-expanded` annotations are removed from compile-fail tests, they are not tested with pretty-printer. Closes rust-lang#23623 in favor of more specific rust-lang#37201 and rust-lang#37199 r? @nrc
eddyb
added a commit
to eddyb/rust
that referenced
this issue
Oct 19, 2016
Fix some pretty printing tests Many pretty-printing tests are un-ignored. Some issues in classification of comments (trailing/isolated) and blank line counting are fixed. Some comments are printed more carefully. Some minor refactoring in pprust.rs `no-pretty-expanded` annotations are removed because this is the default now. `pretty-expanded` annotations are removed from compile-fail tests, they are not tested with pretty-printer. Closes rust-lang#23623 in favor of more specific rust-lang#37201 and rust-lang#37199 r? @nrc
Triage: the output looks a little odd because it doesn't keep the alignment, but the bug reported here is now fixed:
|
If this is fixed, then the tests need to be un-ignored, reopening until that is done. |
petrochenkov
added
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
and removed
C-bug
Category: This is a bug.
labels
Jul 7, 2021
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Jul 13, 2021
…trochenkov Unignore some pretty printing tests Closes rust-lang#37201 r? `@petrochenkov`
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Jul 13, 2021
…trochenkov Unignore some pretty printing tests Closes rust-lang#37201 r? ``@petrochenkov``
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this issue
Jul 13, 2021
…trochenkov Unignore some pretty printing tests Closes rust-lang#37201 r? ```@petrochenkov```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-pretty
Area: Pretty printing (including `-Z unpretty`)
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Example:
=>
Affected tests:
[pretty] pretty\issue-20427.rs
[pretty] pretty\issue-22992.rs
[pretty] pretty\issue-23338-ensure-param-drop-order.rs
[pretty] pretty\issue-27401-dropflag-reinit.rs
The issue disappears if comments are not packed into
ibox
(seetry!(self.ibox(0))
andself.end()
in pprust.rs/fn print_comment/comments::Trailing), but formatting become worse and other tests fail.I spent whole day investigating how these boxes work and reading Derek C. Oppen's "Pretty Printing" but still have no idea why this extra newline appears.
The text was updated successfully, but these errors were encountered: