Skip to content

Pretty-printer inserts an extra newline before the first match arm if it has a comment #37199

Open
@petrochenkov

Description

@petrochenkov

Example:

fn main() {
    match 0u8 {
        // Comment
        0 => {}
        _ => {}
    }
}

=>

fn main() {
    match 0u8 {

        // Comment
        0 => {
        }
        _ => { }
    }
}

Affected tests:
[pretty] pretty\borrowck\borrowck-pat-enum.rs
[pretty] pretty\issue-11709.rs
[pretty] pretty\issue-28839.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-prettyArea: Pretty printing (including `-Z unpretty`)C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions