-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Pretty-printer inserts an extra newline after multiline trailing comments #37201
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-prettyArea: Pretty printing (including `-Z unpretty`)Area: Pretty printing (including `-Z unpretty`)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Metadata
Metadata
Assignees
Labels
A-prettyArea: Pretty printing (including `-Z unpretty`)Area: Pretty printing (including `-Z unpretty`)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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.