Skip to content

Poor formatting of slice_patterns #2909

Closed
@dtolnay

Description

@dtolnay
#![feature(slice_patterns)]

fn main() {
    match b"123" {
        [0, ..] => {}
        _ => {}
    }
}

As of rustfmt 0.99.1-nightly (da17b68 2018-08-04), formatting produces the following diff which I believe is less readable than the original:

-         [0, ..] => {}
+         [0, _..] => {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPanic, non-idempotency, invalid code, etc.poor-formatting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions