Skip to content

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

Open

Description

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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